Changeset 11441


Ignore:
Timestamp:
12/14/08 12:07:52 (13 years ago)
Author:
ehuelsmann
Message:

Fix compiled MACROLET.13 and MACROLET.14: MACROEXPAND should know about symbol macros while expanding.

Location:
trunk/j/src/org/armedbear/lisp
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/Environment.java

    r11440 r11441  
    309309    };
    310310
     311  // ### environment-add-symbol-binding
     312  public static final Primitive ENVIRONMENT_ADD_SYMBOL_BINDING =
     313    new Primitive("environment-add-symbol-binding", PACKAGE_SYS, true,
     314                  "environment symbol value")
     315    {
     316      @Override
     317      public LispObject execute(LispObject first, LispObject second,
     318                                LispObject third)
     319        throws ConditionThrowable
     320      {
     321        checkEnvironment(first).bind(checkSymbol(second), third);
     322        return first;
     323      }
     324    };
     325   
    311326  // ### empty-environment-p
    312327  private static final Primitive EMPTY_ENVIRONMENT_P =
  • trunk/j/src/org/armedbear/lisp/Primitives.java

    r11391 r11441  
    17281728      }
    17291729    };
     1730
     1731  // ### make-symbol-macro
     1732  private static final Primitive MAKE_SYMBOL_MACRO =
     1733      new Primitive("make-symbol-macro", PACKAGE_SYS, true, "expansion")
     1734  {
     1735      public LispObject execute(LispObject arg) throws ConditionThrowable
     1736      {
     1737          return new SymbolMacro(arg);
     1738      }
     1739  };
     1740
    17301741
    17311742  // ### %defparameter
  • trunk/j/src/org/armedbear/lisp/SymbolMacro.java

    r11391 r11441  
    4848    }
    4949
    50     // ### make-symbol-macro
    51     private static final Primitive MAKE_MACRO =
    52         new Primitive("make-symbol-macro", PACKAGE_SYS, false)
    53     {
    54         public LispObject execute(LispObject arg) throws ConditionThrowable
    55         {
    56             return new SymbolMacro(arg);
    57         }
    58     };
    5950}
  • trunk/j/src/org/armedbear/lisp/precompiler.lisp

    r11439 r11441  
    720720(defun precompile-symbol-macrolet (form)
    721721  (let ((*local-variables* *local-variables*)
     722        (*compile-file-environment*
     723         (make-environment *compile-file-environment*))
    722724        (defs (cadr form)))
    723725    (dolist (def defs)
     
    728730                 :format-control "Attempt to bind the special variable ~S with SYMBOL-MACROLET."
    729731                 :format-arguments (list sym)))
    730         (push (list sym :symbol-macro expansion) *local-variables*)))
     732        (push (list sym :symbol-macro expansion) *local-variables*)
     733        (environment-add-symbol-binding *compile-file-environment*
     734                                        sym
     735                                        (sys::make-symbol-macro expansion))
     736        ))
    731737    (multiple-value-bind (body decls)
    732738        (parse-body (cddr form) nil)
Note: See TracChangeset for help on using the changeset viewer.