weirdness in newlisp

For the Compleat Fan
Post Reply
pda
Posts: 8
Joined: Fri Sep 25, 2020 10:42 am

weirdness in newlisp

Post by 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:

Code: Select all

> (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:

Code: Select all

> (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:

Code: Select all

> (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
Posts: 1
Joined: Wed Nov 18, 2020 6:28 am

Re: weirdness in newlisp

Post by Sin »

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

Post Reply