next up previous
Next: 6.2 macroexpand (xleval.c) Up: 6 マクロの処理 Previous: 6 マクロの処理

6.1 マクロの定義defmacro (xlcont.c)

DEFMACROで行うマクロ定義は,xdefmacro (xlcont.c)でなされます.

/* xdefmacro - special form 'defmacro' */
LVAL xdefmacro()
{
  LVAL sym,fargs,arglist;
  
  /* get the function symbol and
     formal argument list */
  xlsave1(arglist);
  sym = xlgasymbol();
  fargs = xlgalist();
  arglist = makearglist(xlargc,xlargv);
  
  /* make the symbol point
     to a new function definition */
  xlsetfunction(sym,
                xlclose(sym,s_macro,
                        fargs,arglist,
                        NIL,NIL));
  
  /* restore the stack and
     return the function symbol */
  xlpop();
  return (sym);
}


generated through LaTeX2HTML. M.Inaba 平成18年5月6日