[movitz-cvs] CVS movitz

ffjeld ffjeld at common-lisp.net
Thu Feb 1 19:37:41 UTC 2007


Update of /project/movitz/cvsroot/movitz
In directory clnet:/tmp/cvs-serv27765

Modified Files:
	parse.lisp 
Log Message:
Tweak decode-normal-lambda-list to also return whether &key was
present at all.


--- /project/movitz/cvsroot/movitz/parse.lisp	2006/05/05 18:37:37	1.6
+++ /project/movitz/cvsroot/movitz/parse.lisp	2007/02/01 19:37:41	1.7
@@ -9,7 +9,7 @@
 ;;;; Created at:    Fri Nov 24 16:49:17 2000
 ;;;; Distribution:  See the accompanying file COPYING.
 ;;;;                
-;;;; $Id: parse.lisp,v 1.6 2006/05/05 18:37:37 ffjeld Exp $
+;;;; $Id: parse.lisp,v 1.7 2007/02/01 19:37:41 ffjeld Exp $
 ;;;;                
 ;;;;------------------------------------------------------------------
 
@@ -129,8 +129,9 @@
 (defun decode-normal-lambda-list (lambda-list &optional host-symbols-p)
   "3.4.1 Ordinary Lambda Lists.
 Returns the requireds, &optionals, &rests, &keys, and &aux formal variables,
-a boolean signalling whether &allow-other-keys was present, and finally
-the minimum and maximum number of arguments (or nil if max is infinite)."
+a boolean signalling whether &allow-other-keys was present, and then
+the minimum and maximum number of arguments (or nil if max is infinite).
+Finally, whether &key was present or not."
   ;; Movitz extension: &edx <var> may appear first in lambda-list
   (let ((edx-var nil))
     (when (eq 'muerte::&edx (first lambda-list))
@@ -178,10 +179,10 @@
 	      (when (> (length rests) 1)
 		(error "There can only be one &REST formal parameter."))
 	      (let ((maxargs (and (null rests) ; max num. of arguments, or nil.
-				   (null keys)
-				   (not allow-other-keys-p)
-				   (+ (length requireds)
-				      (length optionals))))
+				  (null keys)
+				  (not allow-other-keys-p)
+				  (+ (length requireds)
+				     (length optionals))))
 		    (minargs (length requireds)))
 		(return (values requireds
 				optionals
@@ -199,7 +200,9 @@
 				 ((assert (not maxargs)))
 				 ((evenp (+ (length requireds) (length optionals)))
 				  :even)
-				 (t :odd))))))))))
+				 (t :odd))
+				(not (eq :missing
+					 (getf results (key) :missing)))))))))))
 
 (defun decode-optional-formal (formal)
   "3.4.1.2 Specifiers for optional parameters.




More information about the Movitz-cvs mailing list