[Ecls-list] Re: Critical fixes

Maciek Pasternacki maciekp at japhy.fnord.org
Thu May 12 20:14:24 UTC 2005


On Boomtime, Discord 59, 3171 YOLD, Maciek Pasternacki wrote:

>> thanks to Michael's work on a port of Maxima, several bugs of the 
>> compiler have been uncovered. They are related to the declaration of 
>> special variables in DEFVAR/DEFPARAMETER forms, mainly.
>
> Wow!  cl-ppcre, which I just started to try to compile and run, throws
> much less errors after cvs up. =)  Nevertheless, compiled code still
> barfs while after loading source it works OK.

I found one more bug in compiler; managed just to pin it down to a
minimal example.  Compiled closures returned from function can't refer
to variables declared as special; when closure-generating code is
interpreted, everything is OK.  Here is my example code:

,----
| japhy at lizard:~/Ecls/cl-ppcre-1.2.6 % cat foo.lsp
| (defun foo (a)
|   (let* ((a2 (* a a)))
|     (declare (special a2))
|     (bar (* a a a))))
| japhy at lizard:~/Ecls/cl-ppcre-1.2.6 % cat bar.lsp
| (defun bar (a3)
|   (declare (special a2))
|   (let ((a2 (* a2 a2)))
|     #'(lambda ()
|         (format t "~A ~A~%" a2 a3))))
| japhy at lizard:~/Ecls/cl-ppcre-1.2.6 % ../install20050512180543/bin/ecl
| [...]
| > (load "bar.lsp")
| ;;; Loading "bar.lsp"
| "bar.lsp"
| > (load "foo.lsp")
| ;;; Loading "foo.lsp"
| "foo.lsp"
| > (funcall (foo 3))
| 81 27
| NIL
| > (compile-file "bar.lsp" :verbose nil)
| [...]
| > (compile-file "foo.lsp" :verbose nil)
| [...]
| > (load "bar.fas")
| ;;; Loading "bar.fas"
| "bar.fas"
| > (funcall (foo 3))
| The variable A2 is unbound.
| Broken at LAMBDA.
| >> 
`----

-- 
__    Maciek Pasternacki <maciekp at japhy.fnord.org> [ http://japhy.fnord.org/ ]
`| _   |_\  / { 2.718281828459045235360287471352662497757247093699959574966967
,|{-}|}| }\/ 62772407663035354759457138217852516642742746639193200305992181741
\/   |____/ 359662904357290033429526059563073813232862794349076... ( e )  -><-





More information about the ecl-devel mailing list