[Bese-devel] :lexical-flet

Larry D'Anna smoof-ra at elder-gods.org
Wed Aug 3 22:31:18 UTC 2005


Here's another walker patch.  It adds a :lexical-flet mark similar to
the :lexical-let one, so it can recognise flets from the surrounding
environment.  This patch only adds placeholder functions for cmucl and
openmcl, so it should have no effect on those. 		 

	 --larry 

-------------- next part --------------

New patches:

[recognise flets from the lexical environment (on sbcl)
smoof-ra at elder-gods.org**20050803222732] {
hunk ./src/lexenv.lisp 27
+;fixme 
+#+openmcl
+(defun lexical-functions (environment)
+  (declare (ignore environment))
+  nil)
+
hunk ./src/lexenv.lisp 43
+#+sbcl
+(defun lexical-functions (environment)
+  (mapcar #'first (sb-c::lexenv-funs environment)))
+
+
hunk ./src/lexenv.lisp 57
+
+;fixme 
+#+cmu
+(defun lexical-functions (environment)
+  (declare (ignore environment))
+  nil)
+
hunk ./src/walk.lisp 17
-        (setf walk-env (register walk-env :lexical-let var t))))
+        (setf walk-env (register walk-env :lexical-let var t)))
+      (dolist (fun (lexical-functions lexical-env))
+	(setf walk-env (register walk-env :lexical-flet fun t))))
hunk ./src/walk.lisp 267
+(defclass lexical-application-form (application-form)
+  ())
+
hunk ./src/walk.lisp 291
-         (multiple-value-bind (expansion expanded)
-             (macroexpand-1 form nil)
-           (when expanded
-             (return (walk-form expansion parent env)))))
+	(multiple-value-bind (expansion expanded)
+	    (macroexpand-1 form nil)
+	  (when expanded
+	    (return (walk-form expansion parent env)))))
hunk ./src/walk.lisp 297
-                     (make-instance 'free-application-form))))
+                     (if (lookup env :lexical-flet op)
+			 (make-instance 'lexical-application-form)
+			 (make-instance 'free-application-form)))))
hunk ./src/walk.lisp 325
+(defclass lexical-function-object-form (function-object-form)
+  ())
+
hunk ./src/walk.lisp 336
-                         'free-function-object-form)
+                         (if (lookup env :lexical-flet (second form))
+			     'lexical-function-object-form
+			     'free-function-object-form))
}

Context:

[minor comment fixup
Marco Baringer <mb at bese.it>**20050803085322] 
[Moved defclass progv-form to keep the walker classes defined in alphabetical order 
Marco Baringer <mb at bese.it>**20050803085254] 
[Added walker class for THE forms
Marco Baringer <mb at bese.it>**20050803085210] 
[Minor spacing fixs to the previous patch
Marco Baringer <mb at bese.it>**20050802152421] 
[allow new special forms to be added to the walker by shadowing *walker-handlers*
smoof-ra at elder-gods.org**20050802165355] 
[progv
smoof-ra at elder-gods.org**20050802150342] 
[labels can have declarations inside the body
smoof-ra at elder-gods.org**20050801193433] 
[declares needs to be copied in the labels handler just like the other lambda-function-form slots
smoof-ra at elder-gods.org**20050801193107] 
[oops i forgot to actually make the declaration-form instances
smoof-ra at elder-gods.org**20050801185641] 
[initial support for remembering declarations
smoof-ra at elder-gods.org**20050801184329
 
 this patch adds a mixin called implicit-progn-with-declare-mixin and 
 uses it instead of implicit-progn-mixin in all the places that allow declares.
 It has slot which should contain a list of the declares at the top of the 
 implicit-progn.  This patch doesn't do anything clever with the declares, 
 it just creates declaration-form objects and points their source slots 
 at the original declares, however it would be easy to modify parse-declaration
 to generate more usefull declaration objects.
 
] 
[Call the property :FEATURES, not FEATURES
Marco Baringer <mb at bese.it>**20050729103229] 
[Rename asdf property version to features, add "cps-interpreter"
Marco Baringer <mb at bese.it>**20050728120238] 
[dont need to register allow-other-keys because its not a binding
smoof-ra at elder-gods.org**20050727153603] 
[fixed type name mismatch for allow-other-keys-function-arguement-form
smoof-ra at elder-gods.org**20050727152456] 
[defmethod arguments should be ignorable, not ignore (openmcl warns whenever you ignore a specialized argument)
Marco Baringer <mb at bese.it>**20050726090308] 
[Typo in extract-argument-names
Marco Baringer <mb at bese.it>**20050726090256] 
[Fix generation of defmethod froms from defmethod/cc; added tests
Marco Baringer <mb at bese.it>**20050726085226] 
[Fix handling of optional arguments in apply-cps-lambda
Marco Baringer <mb at bese.it>**20050726085155] 
[More tests
Marco Baringer <mb at bese.it>**20050723133158] 
[Fix a bug in the handling of the case when LOOKUP finds a value for a name but the value is NIL
Marco Baringer <mb at bese.it>**20050723133106] 
[Export the symbol KALL
Marco Baringer <mb at bese.it>**20050723133052] 
[Change the test for constant-form'ness in walk.lisp
Marco Baringer <mb at bese.it>**20050723113019] 
[Extend the walker to handle #'(setf foo) function names
Marco Baringer <mb at bese.it>**20050723104431] 
[Fix bug in the lambda generated for method forms
Marco Baringer <mb at bese.it>**20050720144450] 
[Added ignore declarations to defun/cc and defmethod/cc to make the compiler happy
Marco Baringer <mb at bese.it>**20050720110112] 
[Temporarily comment out the log tests
Marco Baringer <mb at bese.it>**20050720092312] 
[Rename (optional|keyword|rest)-argument-form classes to include the -form suffix
Marco Baringer <mb at bese.it>**20050720092124] 
[Allow defun/cc defined functions te be called outside of a with-call/cc
Marco Baringer <mb at bese.it>**20050720091826] 
[Added support for &optional arguments in cps closures
Marco Baringer <mb at bese.it>**20050720091658] 
[Added defgeneric/cc
Marco Baringer <mb at bese.it>**20050719153441] 
[Move the error checking code for lambda arguments into apply, not lambda (in cps interpreter)
Marco Baringer <mb at bese.it>**20050719153121] 
[More cps tests
Marco Baringer <mb at bese.it>**20050719152327] 
[Fix openmcl's definition of lexical-variables to deal with ccl::definition-environment
Marco Baringer <mb at bese.it>**20050719152230] 
[Added support to the cps interpreter forl communicating with lexical variables
Marco Baringer <mb at bese.it>**20050707094608] 
[walk.lisp depends on lexenv.lisp
Marco Baringer <mb at bese.it>**20050707093140] 
[added support for walking local varibales in the lexical environment
Marco Baringer <mb at bese.it>**20050707093027
 
 this applies to all those variables defined the envorinment object
 grabbed via an &environment macro argument. 
 
] 
[mistyped #+openmcl in lexenv.lisp
Marco Baringer <mb at bese.it>**20050707092959] 
[added src/lexenv.lisp to arnesi.asd
Marco Baringer <mb at bese.it>**20050707091127] 
[Rename src/environment.lisp
Marco Baringer <mb at bese.it>**20050707091114] 
[Initial version of environment.lisp
Marco Baringer <mb at bese.it>**20050707091019] 
[Minor docstring fixup for with-call/cc
Marco Baringer <mb at bese.it>**20050707090619] 
[Big patch including all the cps interpreter stuff upto now
Marco Baringer <mb at bese.it>**20050707083739] 
[Fix bug in handling of defclass-struct's :predicate option
Marco Baringer <mb at bese.it>**20050706105324] 
[Initial Import
Marco Baringer <mb at bese.it>**20050706101657
 This import moves arnesi from arch to darcs. Nothing has actually changed since 
 bese-2004 at common-lisp.net/arnesi--dev--1.4--patch-14
] 
[added arch stuff to boring file
Marco Baringer <mb at bese.it>**20050706101630] 
[Setup boring file
Marco Baringer <mb at bese.it>**20050706100535] 
Patch bundle hash:
38bda27e2c3b2c53b126f6c592652f05c40c4240


More information about the bese-devel mailing list