I don't understand why letn isn't required here, or why let doesn't cause an error:
(let (a 1 b 2 c 3 d '(4 5 6 7) e (flat (list a b c d)))
(println (list a b c d e)))
;−> (1 2 3 (4 5 6 7) (1 2 3 4 5 6 7))
Hmm. I get
(1 2 3 (4 5 6 7) (nil nil nil nil))
as I would expect.
I get:
(1 2 3 (4 5 6 7) (nil nil nil nil))
with newLISP 10.7.5 and 10.7.4 on windows 10.
cameyo
I think newBert just had a polluted outer environment. newBert, try running that code with a freshly started newlisp.
Indeed, I've just tried again now, in a new NewLISP session, and I get the expected result: (1 2 3 (4 5 6 7) (nil nil nil nil)). I'm reassured :). Thank you , RalphRonnquist, Cameyo and Rickyboy for your replies and advice.
I don't know what could have happened... I probably forgot NewLISP has no lexical scoping by default.