Changeset 14463


Ignore:
Timestamp:
Dec 2, 2010, 12:23:36 AM (9 years ago)
Author:
rme
Message:

In NX1-FUNCTION, ensure that we have a lambda expression before calling
NX1-REF-INNER-FUNCTION.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/nx1.lisp

    r14417 r14463  
    13081308  (nx1-treat-as-call w))
    13091309
    1310 
    13111310(defnx1 nx1-function function (arg &aux fn afunc)
    1312   (if (symbolp arg)
    1313     (progn
    1314       (when (macro-function arg *nx-lexical-environment*)
    1315         (nx-error
    1316          "~S can't be used to reference lexically visible macro ~S."
    1317          'function arg))
    1318       (if (multiple-value-setq (fn afunc) (nx-lexical-finfo arg))
    1319         (progn
    1320           (when afunc
    1321             (incf (afunc-fn-refcount afunc))
    1322             (when (%ilogbitp $fbitbounddownward (afunc-bits afunc))
    1323               (incf (afunc-fn-downward-refcount afunc))))
    1324           (nx1-symbol (%cddr fn)))
    1325         (progn
    1326           (while (setq fn (assq arg *nx-synonyms*))
    1327             (setq arg (%cdr fn)))
    1328           (nx1-form `(%function ',arg)))))
    1329     (if (and (consp arg) (eq (%car arg) 'setf))
    1330       (nx1-form `(function ,(nx-need-function-name arg)))
    1331       (nx1-ref-inner-function nil arg))))
     1311  (cond ((symbolp arg)
     1312         (when (macro-function arg *nx-lexical-environment*)
     1313           (nx-error
     1314            "~S can't be used to reference lexically visible macro ~S."
     1315            'function arg))
     1316         (if (multiple-value-setq (fn afunc) (nx-lexical-finfo arg))
     1317           (progn
     1318             (when afunc
     1319               (incf (afunc-fn-refcount afunc))
     1320               (when (%ilogbitp $fbitbounddownward (afunc-bits afunc))
     1321                 (incf (afunc-fn-downward-refcount afunc))))
     1322             (nx1-symbol (%cddr fn)))
     1323           (progn
     1324             (while (setq fn (assq arg *nx-synonyms*))
     1325               (setq arg (%cdr fn)))
     1326             (nx1-form `(%function ',arg)))))
     1327        ((setf-function-name-p arg)
     1328         (nx1-form `(function ,(nx-need-function-name arg))))
     1329        ((lambda-expression-p arg)
     1330         (nx1-ref-inner-function nil arg))
     1331        (t
     1332         (nx-error "~S is not a function name or lambda expression" arg))))
    13321333
    13331334(defnx1 nx1-nfunction nfunction (name def)
Note: See TracChangeset for help on using the changeset viewer.