Something weird was going on when I used (load) in a Terminal to load a file that I'd created using BBEdit. newLISP was executing the statements at the top of the file (i hadn't included the #!/usr/bin/newlisp line - I didn't think files to be loaded needed it), even though I'd preceded them with a semicolon. It took a long time for me to discover this - it was after I'd commented out a (context ...) command and noticed the errors relating to that context were still appearing.
I investigated further, and I got the problem to go away if I changed the document encoding from 'UTF8' to 'UF8 - no BOM', or if I added the #!/usr/bin/newlisp line at the top.
The reason I didn't put #!/usr/bin/newlisp at the top is because when i loaded a file with that in it I also got a new symbol created, called '#!/usr/bin/newlisp'... Which didn't seem right...
MacOS - odd behaviour - BBEdit and (load) - a UTF8 issue?
-
- Posts: 2038
- Joined: Tue Nov 29, 2005 8:28 pm
- Location: latiitude 50N longitude 3W
- Contact:
I used Textwrangler for a while (the free version of BBEdit) but did not have this problem.
I sounds to me, as if BBEdit is encoding the # sign with something else, because newLISP will always take it as beginning of a comment, not a symbol.
Try the following to find out what really is in that first line:
This should start with the numbers 35 33 47 for #!/
Lutz
I sounds to me, as if BBEdit is encoding the # sign with something else, because newLISP will always take it as beginning of a comment, not a symbol.
Try the following to find out what really is in that first line:
Code: Select all
(map char (explode (read-file "problemfile.lsp")))
Lutz
-
- Posts: 2038
- Joined: Tue Nov 29, 2005 8:28 pm
- Location: latiitude 50N longitude 3W
- Contact:
A UTF8 file gives the following for that code:
whereas a 'UTF8 - no BOM' gives:
That's the problem, obviously. Perhaps this is a general Unix thing...
Code: Select all
(65279 35 33 47 117 115 114 47 98 ..
Code: Select all
(35 33 47 117 115 114 47