[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Axiom-developer] clisp and sbcl
From: |
Waldek Hebisch |
Subject: |
Re: [Axiom-developer] clisp and sbcl |
Date: |
Mon, 28 May 2007 15:30:16 +0200 (CEST) |
> On Mon, 28 May 2007, Waldek Hebisch wrote:
>
> [...]
>
> | The problem is more subtle: the code above (printed by sbcl)
> | references |#1|. Apparently sbcl complier does not see that
> | |#1| is defined, but it is.
> |
> | In more detail, Axiom uses Lisp eval to replace |#1| by aproproate
> | value. Relevant part of backtrace is:
> |
> | 17: (SB-INT:SIMPLE-EVAL-IN-LEXENV (EQCAR |#1| 0) #<NULL-LEXENV>)
> | 18: (|evalSharpOne|
> | (EQCAR |#1| 0)
> | (0 (1 #(#(|cos| 1 (#)) ((# 0 . 1)) 2 4864) (1 0 . -1)) 0 . 1))
> | 19: (|coerceUnion2Branch|
> | ((|Union| (|Expression| (|Integer|)) (|List| (|Expression|
> (|Integer|))))
> | WRAPPED 0 (1 #(#(|cos| 1 (#)) ((# 0 . 1)) 2 4864) (1 0 . -1)) 0 . 1))
> |
> |
> | |evalSharpOne| is defined as:
> |
> | (defun |evalSharpOne| (x \#1) (declare (special \#1)) (EVAL x))
> |
^ ^
| |
definition declaration
> | so at the time of eval |#1| has special binding. My understanding is
> | that such bindings are visible to eval.
>
> The above shows that |#1| is *declared*. But whereis it defined?
>
Using parameters to establish special binding is very frequent idiom
in Axiom code. I guess that from Ansi point of view '(EQCAR |#1| 0)'
may be incorrect, because it lacks special declaration. Ansi would
like something like:
(defun |evalSharpOne| (x |#1|) (declare (special |#1|))
(EVAL `(let () (declare (special |#1|) ,x))))
Or maybe:
(defun |evalSharpOne| (x y)
(EVAL `(let ((|#1| ,y)) ,x)))
The second one does not create special binding, which would be more
tidy if x does not call functions referencing special binding of |#1|.
BTW. This remaind me of your change replacing global SETQ by DEFPARAMETER.
IIUC
(defparameter x y)
is equivalent to
(defvar x)
(setf x y)
It looks for me that replacing SETQ by DEFPARAMETER defeats much of the
purpose of DEFPARAMETER/DEFVAR: we silence _all_ warnings about assignments
to undefined variables, loosing them also when variable name is
spelled incorrectly. I would prefer to have in a _single_ place explicit
DEFVAR/DEFPARAMETER declaration and in all other places use SETQ.
--
Waldek Hebisch
address@hidden
- [Axiom-developer] clisp and sbcl, Waldek Hebisch, 2007/05/22
- Re: [Axiom-developer] clisp and sbcl, C Y, 2007/05/22
- Re: [Axiom-developer] clisp and sbcl, Waldek Hebisch, 2007/05/23
- Re: [Axiom-developer] clisp and sbcl, C Y, 2007/05/23
- Re: [Axiom-developer] clisp and sbcl, C Y, 2007/05/25
- Re: [Axiom-developer] clisp and sbcl, Waldek Hebisch, 2007/05/25
- Re: [Axiom-developer] clisp and sbcl, Gabriel Dos Reis, 2007/05/25
- Re: [Axiom-developer] clisp and sbcl, Waldek Hebisch, 2007/05/28
- Re: [Axiom-developer] clisp and sbcl, Gabriel Dos Reis, 2007/05/28
- Re: [Axiom-developer] clisp and sbcl,
Waldek Hebisch <=
- Re: [Axiom-developer] clisp and sbcl, Gabriel Dos Reis, 2007/05/28
- Re: [Axiom-developer] clisp and sbcl, Gabriel Dos Reis, 2007/05/28
- Re: [Axiom-developer] clisp and sbcl, Waldek Hebisch, 2007/05/28
- Re: [Axiom-developer] clisp and sbcl, Gabriel Dos Reis, 2007/05/28
- Re: [Axiom-developer] clisp and sbcl, Gabriel Dos Reis, 2007/05/29
- Re: [Axiom-developer] clisp and sbcl, Waldek Hebisch, 2007/05/29
- Re: [Axiom-developer] clisp and sbcl, Bill Page, 2007/05/23