weirdness in newlisp

Started by pda, November 15, 2020, 04:02:08 PM

Previous topic - Next topic

pda

Hi,



I got again weird behaviour coding in newlisp.



I'm using  newLISP v.10.7.5 64-bit on Windows UTF8 libffi  using the NewLisp GS v.1.6

The downloaded zipped version  was a bit lower and then I downloaded the last exe and dll and overwrite the installed ones.



Now when I type this function in edit area of NewLisp GS or in REPL area, it is defined right:


> (define (utf8code c) (cond ((< c 128) "0xxxxxxx") ((< c 2048) "110xxxxx 10xxxxxx") ((< c 65536) "1110xxxx 10xxxxxx 10xxxxxx") ((< c 1114112) "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx")))
(lambda (c)
 (cond
  ((< c 128) "0xxxxxxx")
  ((< c 2048) "110xxxxx 10xxxxxx")
  ((< c 65536) "1110xxxx 10xxxxxx 10xxxxxx")
  ((< c 1114112) "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx")))


but if I add little pretty print to it, then everything goes wrong:



> (define (utf8code c)
(cond ((< c 128) "0xxxxxxx") ((< c 2048) "110xxxxx 10xxxxxx") ((< c 65536) "1110xxxx 10xxxxxx 10xxxxxx") ((< c 1114112) "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx")))


ERR: missing parenthesis : "...(define (utf8code c) n"
> "0xxxxxxx"

ERR: missing parenthesis : "..."11110xxx 10xxxxxx 10xxxxxx 10xxxxxx"��e"


It seems newlisp is not able to figure out function definition is not complete because entering the REPL in command line I get:


> (define (f a)

ERR: missing parenthesis : "...(define (f a)n"


It seems like newlisp 10.7.5 only accepts one liners



Maybe is it a problem terminal not supporting unicode?   I tested with  windows cmd, windows powershell and mobaxterm (cygwin)

Sin

#1
No. It also accepts many-liners. It is enough to press the return key, paste your code, and then press the return key again.