Re: automatic generation of letrule packages



--- Robert Dodier  wrote:
 
> It appears that let evaluates its first argument but quotes
> the second; I believe this explains the behavior you observed.

Err - sorry, brain out to lunch.  This is correct, and in fact we had
to work around exactly this behavior for the unit package.

> It is something of a custom to use apply to cause evaluation
> of arguments for argument-quoting functions.

That's the solution Barton came up with, originally from (IIRC) Jeff
Golden.  Something of the form:

letplus(exp,ruleset) := apply('let,[exp,ruleset]);

is what we use.  Just FYI, the relevant code in lisp is in nisimp.lisp
line 66 - changing it as follows:

<   (setq replacement (cdr l))
>   (setq replacement (list (meval (cadr l))))

also worked, but you probably want to avoid changing the default
behavior of let so the recommend solution is use apply.  If you want to
change the lisp code and need the old behavior you need to do something
like let(expr,'ruleset) IIRC.  Defining a custom let function is much
cleaner, at least until we can be sure there isn't a reason for the
current let behavior.

CY


		
__________________________________ 
Yahoo! Mail Mobile 
Take Yahoo! Mail with you! Check email on your mobile phone. 
http://mobile.yahoo.com/learn/mail