home *** CD-ROM | disk | FTP | other *** search
- *** old-eval.c Tue Oct 29 20:36:57 1991
- --- eval.c Tue Oct 29 20:48:59 1991
- ***************
- *** 715,720 ****
- --- 715,722 ----
- return Qnil;
- }
-
- + /* better version of this from Hallvard Furuseth.
- + */
- DEFUN ("macroexpand", Fmacroexpand, Smacroexpand, 1, 2, 0,
- "Return result of expanding macros at top level of FORM.\n\
- If FORM is not a macro call, it is returned unchanged.\n\
- ***************
- *** 734,771 ****
- in case it expands into another macro call. */
- if (XTYPE (form) != Lisp_Cons)
- break;
- ! sym = XCONS (form)->car;
- ! /* Detect ((macro lambda ...) ...) */
- ! if (XTYPE (sym) == Lisp_Cons
- ! && EQ (XCONS (sym)->car, Qmacro))
- ! {
- ! expander = XCONS (sym)->cdr;
- ! goto explicit;
- ! }
- ! if (XTYPE (sym) != Lisp_Symbol)
- ! break;
- /* Trace symbols aliases to other symbols
- until we get a symbol that is not an alias. */
- ! while (1)
- {
- QUIT;
- tem = Fassq (sym, env);
- if (NULL (tem))
- {
- def = XSYMBOL (sym)->function;
- ! if (XTYPE (def) == Lisp_Symbol && !EQ (def, Qunbound))
- ! sym = def;
- ! else
- ! break;
- }
- ! else
- ! {
- ! if (XTYPE (tem) == Lisp_Cons
- ! && XTYPE (XCONS (tem)->cdr) == Lisp_Symbol)
- ! sym = XCONS (tem)->cdr;
- ! else
- ! break;
- ! }
- }
- /* Right now TEM is the result from SYM in ENV,
- and if TEM is nil then DEF is SYM's function definition. */
- --- 736,758 ----
- in case it expands into another macro call. */
- if (XTYPE (form) != Lisp_Cons)
- break;
- ! /* Set SYM, give DEF and TEM right values in case SYM is not a symbol. */
- ! def = sym = XCONS (form)->car;
- ! tem = Qnil;
- /* Trace symbols aliases to other symbols
- until we get a symbol that is not an alias. */
- ! while (XTYPE (def) == Lisp_Symbol)
- {
- QUIT;
- + sym = def;
- tem = Fassq (sym, env);
- if (NULL (tem))
- {
- def = XSYMBOL (sym)->function;
- ! if (!EQ (def, Qunbound))
- ! continue;
- }
- ! break;
- }
- /* Right now TEM is the result from SYM in ENV,
- and if TEM is nil then DEF is SYM's function definition. */
- ***************
- *** 797,803 ****
- if (NULL (expander))
- break;
- }
- - explicit:
- form = apply1 (expander, XCONS (form)->cdr);
- }
- return form;
- --- 784,789 ----
-