[clpython-devel] `#1=(,) ... `#1# fails on ccl.

Pascal J. Bourguignon pjb at informatimago.com
Mon Jan 14 13:32:44 UTC 2013


 Hi!

 When trying to load a module (import ast) in clpython on ccl 
 (1.9-dev-r15508), it fails
 on  `(let* ((.undecorated-func #1#) ...)

 with the following patch, it works better.  Since the expansion of #\` 
 is implementation dependent,
 it might be safer to avoid kludges involving it.


 ------------------------------------------------------------------------------------------------------
 diff --git a/compiler/compiler.lisp b/compiler/compiler.lisp
 index 6bbc61a..adf8bb7 100644
 --- a/compiler/compiler.lisp
 +++ b/compiler/compiler.lisp
 @@ -1212,15 +1212,19 @@ LOCALS shares share tail structure with input 
 arg locals."
                                          (if **-arg #x08 0)
                                          (if generator-p #x20 0)))))
            (when (keywordp fname)
 -	    (return-from funcdef-stmt-1 `#1=(make-py-function :name ',fname
 -                                                              
 :context-name ',context-fname
 -                                                              :lambda 
 ,func-lambda
 -                                                              
 :func-globals ,(get-module-namespace e)
 -                                                              
 :func-code ,func-code)))
 +            (return-from funcdef-stmt-1 `(make-py-function :name 
 ',fname
 +                                                           
 :context-name ',context-fname
 +                                                           :lambda 
 ,func-lambda
 +                                                           
 :func-globals ,(get-module-namespace e)
 +                                                           :func-code 
 ,func-code)))
            (let ((art-deco '.undecorated-func))
              (dolist (x (reverse decorators))
                (setf art-deco `(py-call ,x ,art-deco)))
 -            `(let* ((.undecorated-func #1#)
 +            `(let* ((.undecorated-func (make-py-function :name ',fname
 +                                                         :context-name 
 ',context-fname
 +                                                         :lambda 
 ,func-lambda
 +                                                         :func-globals 
 ,(get-module-namespace e)
 +                                                         :func-code 
 ,func-code))
                      (.decorated-func ,art-deco))
                 ;; Ugly special case:
                 ;;  class C:
 ------------------------------------------------------------------------------------------------------

-- 
 __Pascal Bourguignon__




More information about the Clpython-devel mailing list