ct-gradual-typing / Papers

The Combination of Dynamic and Static Typing from a Categorical Perspective
10 stars 0 forks source link

Repl load file command and trailing whitespace #44

Closed heades closed 7 years ago

heades commented 7 years ago

Consider the following example:

Grady> :l Examples/Combinator.gry
Examples/Combinator.gry  does not exist.
Grady> :l Examples/Combinator.gry
(line 11, column 12):
unexpected "\n"
expecting digit or ";"
Grady>

The first load command has a space at the end of the line, and the second does not.

Now consider the following:

Grady> :l Examples/Combinator.gry                    
Examples/Combinator.gry                     does not exist.
Grady> 

Notice the spaces before "does".

Whitespace needs to be trimmed off of the end of the file name.

michaelto20 commented 7 years ago

I can't repeat this same error with the white space. If I try your example, I get the same error but that's only because the Combinator.gry file is now called Fix.gry. Can you double check this on your end?

heades commented 7 years ago

I still get it:

Grady> :l Examples/Naturals.gry                  
Examples/Naturals.gry                   does not exist.
Grady> 

Either way, an easy fix is just to trim the whitespace off the end before reading the file.

heades commented 7 years ago

See Data.Text; there is strip.

michaelto20 commented 7 years ago

Will do

On Jan 10, 2017, at 17:54, Harley D. Eades III notifications@github.com wrote:

See Data.Text; there is strip.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub, or mute the thread.

michaelto20 commented 7 years ago

Should trim the white space now. Can you double check on your machine?

heades commented 7 years ago

Sure, I will check. Remember not to close issues until we both agree. :-)

heades commented 7 years ago

Looks like it is fixed! Great work!

heades commented 7 years ago

It is now merged into master.