<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12px"><div id="yui_3_16_0_1_1426625360765_6432">George,</div><div id="yui_3_16_0_1_1426625360765_6497"><br></div><div id="yui_3_16_0_1_1426625360765_6517" dir="ltr"> Your unicode comment made me wonder. So I wrote out some code to the repl and it "compiled" and ran fine. Next I copied that code to Notepad and then copied and pasted it back to the repl and it "compiled" and ran fine. Finally I google "scheme factorial" and copied what I found to the repl and there I had problems.</div><div id="yui_3_16_0_1_1426625360765_6754" dir="ltr"><br></div><div id="yui_3_16_0_1_1426625360765_6772" dir="ltr"> First saw this in the arc programming language, which is based on Racket.</div><div id="yui_3_16_0_1_1426625360765_6793" dir="ltr"><br></div><div id="yui_3_16_0_1_1426625360765_6812" dir="ltr"> The funny thing is that a number of other Scheme implementations do not act thusly. I wonder what can be done to remove this from Racket.<br></div><div id="yui_3_16_0_1_1426625360765_6769" dir="ltr"><br></div><div id="yui_3_16_0_1_1426625360765_6771" dir="ltr"><br></div><div id="yui_3_16_0_1_1426625360765_6770" dir="ltr">Steve</div><div id="yui_3_16_0_1_1426625360765_6791" dir="ltr"><br></div><div id="yui_3_16_0_1_1426625360765_6810" dir="ltr">---</div><div id="yui_3_16_0_1_1426625360765_6811" dir="ltr"><br></div><div dir="ltr" id="yui_3_16_0_1_1426625360765_6526"><font size="2">;; Typed into repl<br></font></div><div dir="ltr" id="yui_3_16_0_1_1426625360765_6550"><font id="yui_3_16_0_1_1426625360765_6682" size="2" face="Courier New, courier, monaco, monospace, sans-serif">> (define (fact n)<br style="" class=""> (if (< n 2)<br style="" class=""> 1<br style="" class=""> (* n (fact (- n 1)))))<br style="" class="">> (fact 5)<br style="" class="">120<br style="" class="">;; Copied from Notepad into repl</font></div><div id="yui_3_16_0_1_1426625360765_6726" dir="ltr"><font id="yui_3_16_0_1_1426625360765_6682" size="2" face="Courier New, courier, monaco, monospace, sans-serif">> (define (fact n)<br style="" class=""> (if (< n 2)<br style="" class=""> 1<br style="" class=""> (* n (fact (- n 1)))))<br style="" class="">> (fact 5)<br style="" class="">120<br style="" class="">;; Copied from browser into repl</font></div><div id="yui_3_16_0_1_1426625360765_6731" dir="ltr"><font id="yui_3_16_0_1_1426625360765_6682" size="2" face="Courier New, courier, monaco, monospace, sans-serif">> (define (factorial n)<br style="" class=""> (if (= n 0)<br style="" class=""> 1<br style="" class=""> (* n (factorial (- n 1)))))<br style="" class="">stdin::355: if: bad syntax;<br style="" class=""> has 4 parts after keyword<br style="" class=""> in: (if (= n 0) 1 R (* n (factorial (- n 1))))<br style="" class=""> context...:<br style="" class=""> C:\Program Files\Racket\collects\racket\private\misc.rkt:87:7<br style="" class="">><br></font></div><div id="yui_3_16_0_1_1426625360765_6404" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12px;"><font size="2" face="Courier New, courier, monaco, monospace, sans-serif"> </font><div id="yui_3_16_0_1_1426625360765_6403" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"><font size="2" face="Courier New, courier, monaco, monospace, sans-serif"> </font><div id="yui_3_16_0_1_1426625360765_6409" dir="ltr"><font size="2" face="Courier New, courier, monaco, monospace, sans-serif"> </font><hr id="yui_3_16_0_1_1426625360765_6789" size="1"><font size="2" face="Courier New, courier, monaco, monospace, sans-serif"> </font><font id="yui_3_16_0_1_1426625360765_6408" size="2" face="Arial"><font face="Courier New, courier, monaco, monospace, sans-serif"> </font><b><span style="font-weight:bold;">From:</span></b> George Neuner <gneuner2@comcast.net><br> <b><span style="font-weight: bold;">To:</span></b> users@racket-lang.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Tuesday, March 17, 2015 2:21 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [racket] Error when pasting code<br> </font> </div> <div id="yui_3_16_0_1_1426625360765_6402" class="y_msg_container"><br>On Tue, 17 Mar 2015 19:06:50 +0000 (UTC), Steve Graham<br><<a id="yui_3_16_0_1_1426625360765_6570" ymailto="mailto:jsgrahamus@yahoo.com" href="mailto:jsgrahamus@yahoo.com">jsgrahamus@yahoo.com</a>> wrote:<br><br>>When running the following code, when manually typed in, there is no<br>>error. However, when the same is pasted from the keyboard buffer,<br>>the error indicated appears.<br>>Comments?<br>>Thanks, Steve<br><br>Likely there are hidden control characters being carried when you cut<br>and paste.<br><br>I've had troubles going back and forth between DrRacket and various<br>unicode aware code editors - everything from syntax errors compiling<br>to DrRacket hanging or even crashing trying to load source files.<br>Inevitably it is because some hidden character(s) snuck in.<br><br>I haven't actually experienced it with cut-n-paste, but it would not<br>surprise me.<br><br>George<br><br>____________________<br> Racket Users list:<br> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br><br><br></div> </div> </div> </div></body></html>