small patch that turns funcall/cc and apply/cc into a macro.
(I need to tidy up my major changes that speed up cl-cont a lot by doing
fewer unnecessary transformations and not making so many
funcallable/ccs, they are still not ready and this patch is not relevant
to them.)
PS. Note that according to the spec (declaim (inline ...)) should occur
before the function definition (unless you do that thing won't actually
be inlined on SBCL)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"weblocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/weblocks?hl=en
-~----------~----~----~----~------~----~------~--~---
diff -rN -u old-cl-cont/src/special-transformers.lisp new-cl-cont/src/special-transformers.lisp
--- old-cl-cont/src/special-transformers.lisp 2009-07-25 10:00:10.265050993 +0000
+++ new-cl-cont/src/special-transformers.lisp 2009-07-25 10:00:10.312006472 +0000
@@ -210,6 +210,7 @@
(apply (f/cc-function ,inst) #'values args))))
inst))
+(declaim (inline fdesignator-to-function/cc))
(defun fdesignator-to-function/cc (fdesignator)
"Converts a function designator to a function/cc."
(let ((lookup (if (symbolp fdesignator)
@@ -219,18 +220,14 @@
(funcallable/cc (f/cc-function lookup))
(t (lambda(k &rest args)
(multiple-value-call k (apply lookup args)))))))
-(declaim (inline fdesignator-to-function/cc))
-(defun funcall/cc (fdesignator k &rest args)
+(defmacro funcall/cc (fdesignator k &rest args)
"Implements FUNCALL for a CPS converter."
- (apply (fdesignator-to-function/cc fdesignator) k args))
-#-sbcl
-(declaim (inline funcall/cc))
+ `(funcall (fdesignator-to-function/cc ,fdesignator) ,k ,@args))
-(defun apply/cc (fdesignator k &rest args)
+(defmacro apply/cc (fdesignator k &rest args)
"Implements FUNCALL for a CPS converter."
- (apply #'apply (fdesignator-to-function/cc fdesignator) k args))
-(declaim (inline apply/cc))
+ `(apply (fdesignator-to-function/cc ,fdesignator) ,k ,@args))
(defun lambda-expr->cps (cons k-expr env)
"Converts a LAMBDA expression to CPS style."