defmspec questions



Robert Dodier wrote:

> CY wrote:
> 
> 
That;s all that defmspec does. Sometimes you must forbid
the evaluation of some or all of the arguments to a function.

The Maclisp dialect of lisp had lots of different
mechanisms for argument evaluation.

expr = usual evaluation
subr =  compiled version of expr

then there were fexpr, lexpr, and I guess macro.  Plus
some others like fexpr*  I think.  Macsyma imitated this
diversity by allowing mfexpr .

We used to define ordinary functions by
(defprop  foo  (lambda(x) ....)  expr)

or
(putprop 'foo '(lambda(x) ...) 'expr)

[approximately;  I am trying to recall from dim memory...]

RJF

>>For some expressions (e.g. $tellsimp) the definition is made
>>not with defun or defmfun but defmspec, which is a macro in 
>>maxmac.lisp.  It seems to be assigning mfexpr* to a property,
>>but it is not immediately apparent what this is doing.  
> 
> 
> defmspec is the means by which argument-quoting functions
> are implemented. When the function is called, the entire
> function call (operator plus arguments) is handed over 
> verbatim (not even simplified). It is then under the control
> of the function to selectively evaluate some, all, or none
> of the arguments. E.g.
> 
>   :lisp (defmspec $f (l) (format t "~S~%" l))
> 
>   f (1 + 3)  =>  (($F) ((MPLUS) 1 3))
>    
>   :lisp (defmspec $f (l) (let ((x (cadr l))) ($print x '&equals (meval
> x))))
> 
>    f (3 + 2)  =>  3 + 2 equals 5
> 
> I don't know if defmspec has other useful properties
> aside from the argument-quoting business.
> 
> For what it's worth,
> Robert Dodier
> 
> 
> 		
> __________________________________ 
> Discover Yahoo! 
> Use Yahoo! to plan a weekend, have fun online and more. Check it out! 
> http://discover.yahoo.com/
> 
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima