From: Min-soup Roh
Subject: difference of defun and demacro
Date: 
Message-ID: <336171A4.41C6@kyebek3.kjist.ac.kr>
I want to know difference of defun and demacro.

especially, whiling executing, each defun and demacro is how to manage
to memory , excute binary code,  bind memory and return. e.s..
From: Barry Margolin
Subject: Re: difference of defun and demacro
Date: 
Message-ID: <5jrkq7$128@tools.bbnplanet.com>
In article <·············@kyebek3.kjist.ac.kr>,
Min-soup Roh  <·····@kyebek3.kjist.ac.kr> wrote:
>I want to know difference of defun and demacro.

DEFUN defines a normal function.  When it's used, all the parameter forms
are evaluated, and these values are passed to the function.  It does
whatever it does and returns some values to the caller.

DEFMACRO defines a macro, which is used to rewrite code.  When it's used,
it receives the parameters unevaluated.  It returns a single value which
should be new Lisp code, and this code is then evaluated in place of the
original macro call.

>especially, whiling executing, each defun and demacro is how to manage
>to memory , excute binary code,  bind memory and return. e.s..

These are done the same in both.  They both have full access to the power
of Lisp.  They can use functions like CONS and LIST to create lists, they
can call other functions, they can bind memory with LET, etc.  There are
some tricky details with macros calling other functions -- you have to use
EVAL-WHEN to ensure that the functions it calls are available in the
compile-time environment.  In a Lisp class this would be a full lecture, so
I'm not going to attempt it over the net.
-- 
Barry Margolin
BBN Corporation, Cambridge, MA
······@bbnplanet.com
(BBN customers, call (800) 632-7638 option 1 for support)