defmspec questions



CY wrote:

> 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/