Page 1 of 1

I suppose there is no progn

Posted: Thu May 14, 2009 4:18 am
by shercipher
For expressions that need to be evaluated sequentially in newLisp, there is no progn special form that says "evaluate these and return the last".

So how do I make code like this valid?

Code: Select all

(if (expr)
 ((eval 1) (eval 2) (eval3))
 (eval4))
It seems to execute the forms correctly, except that at the end of executing the forms it says "ERR: value expected: (whatever the last form was)"

Posted: Thu May 14, 2009 5:29 am
by HPW
Use 'begin' instead.

Or somewhere:

Code: Select all

(setq progn begin)
(constant(global 'progn))
Then you have 'progn'

Posted: Thu May 14, 2009 12:03 pm
by Lutz
In the manual:

http://www.newlisp.org/newlisp_manual.html#begin

In the Code Patterns document in the "Blocks" section:

http://www.newlisp.org/CodePatterns.html#flow