X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fnode.lisp;h=0615b216bdfe62572400c51d4eb0189dc7adb476;hb=a1a2c079c7654defb618baad0dddcf0eaf2ce64f;hp=f2e2900a53291f31e06617dc1bbad767a5232884;hpb=0b5610d8a220a4b20cbeac958953ca4d67c00038;p=sbcl.git diff --git a/src/compiler/node.lisp b/src/compiler/node.lisp index f2e2900..0615b21 100644 --- a/src/compiler/node.lisp +++ b/src/compiler/node.lisp @@ -173,7 +173,7 @@ ;; Following the introduced forms is a representation of the ;; location of the enclosing original source form. This transition ;; is indicated by the magic ORIGINAL-SOURCE-START marker. The first - ;; element of the orignal source is the "form number", which is the + ;; element of the original source is the "form number", which is the ;; ordinal number of this form in a depth-first, left-to-right walk ;; of the truly top-level form in which this appears. ;; @@ -183,7 +183,7 @@ ;; ;; The last element in the list is the top-level form number, which ;; is the ordinal number (in this call to the compiler) of the truly - ;; top-level form containing the orignal source. + ;; top-level form containing the original source. (source-path *current-path* :type list) ;; If this node is in a tail-recursive position, then this is set to ;; T. At the end of IR1 (in environment analysis) this is computed @@ -776,8 +776,8 @@ (arglist nil :type list) ;; true if &ALLOW-OTHER-KEYS was supplied (allowp nil :type boolean) - ;; true if &KEY was specified (doesn't necessarily mean that there - ;; are any keyword arguments...) + ;; true if &KEY was specified (which doesn't necessarily mean that + ;; there are any &KEY arguments..) (keyp nil :type boolean) ;; the number of required arguments. This is the smallest legal ;; number of arguments. @@ -830,17 +830,18 @@ ;; defaults even when there is no user-specified supplied-p var. (supplied-p nil :type (or lambda-var null)) ;; the default for a keyword or optional, represented as the - ;; original Lisp code. This is set to NIL in keyword arguments that - ;; are defaulted using the SUPPLIED-P arg. + ;; original Lisp code. This is set to NIL in &KEY arguments that are + ;; defaulted using the SUPPLIED-P arg. (default nil :type t) - ;; the actual keyword for a keyword argument - (keyword nil :type (or keyword null))) + ;; the actual key for a &KEY argument. Note that in ANSI CL this is not + ;; necessarily a keyword: (DEFUN FOO (&KEY ((BAR BAR))) ..). + (key nil :type symbol)) (defprinter (arg-info) (specialp :test specialp) kind (supplied-p :test supplied-p) (default :test default) - (keyword :test keyword)) + (key :test key)) ;;; The LAMBDA-VAR structure represents a lexical lambda variable. ;;; This structure is also used during IR1 conversion to describe @@ -1069,6 +1070,22 @@ ;; *UNDEFINED-WARNING-LIMIT* calls. (warnings () :type list)) +;;; a helper for the POLICY macro, defined late here so that the +;;; various type tests can be inlined +(declaim (ftype (function ((or list lexenv node functional)) list) + %coerce-to-policy)) +(defun %coerce-to-policy (thing) + (let ((result (etypecase thing + (list thing) + (lexenv (lexenv-policy thing)) + (node (lexenv-policy (node-lexenv thing))) + (functional (lexenv-policy (functional-lexenv thing)))))) + ;; Test the first element of the list as a rudimentary sanity + ;; that it really does look like a valid policy. + (aver (or (null result) (policy-quality-name-p (caar result)))) + ;; Voila. + result)) + ;;;; Freeze some structure types to speed type testing. #!-sb-fluid