Re: [Sbcl-devel] Environments in SB-WALKER

Hello,
Christophe Rhodes <csr21@...> writes:
> Hi,
>
> Attached is a patch (thanks to Gerd Moellmann, who pointed me in the
> right direction and pushed me most of the way there :-) that seems to
> fix bug 222 -- Alexey, do you have any other nasty test cases for
> this?
Does Walker augment environment with local functions/variables? May be
MAKE-RESTRICTED-LEXENV should be used somewhere. I'll look at it.
--
Regards,
Alexey Dejneka

Thread view

Hi,
Attached is a patch (thanks to Gerd Moellmann, who pointed me in the
right direction and pushed me most of the way there :-) that seems to
fix bug 222 -- Alexey, do you have any other nasty test cases for this?
The patch comes with one or two health warnings... as can be seen, it's
a lot more aggressive about passing walker-constructed LEXENV objects to
the main system, as it passes one to SB-INT:EVAL-IN-LEXENV. It's by no
means clear to me that this is safe in general, though I suspect that
for most uses it's probably OK.
The other health warning relates to bug 63... I suspect that the "messed
up" portion that Paul was referring to relates primarily to
symbol-macros; they seem to be placed in the function slot of the
lexenv in some cases. This turns out not to matter in the uses of the
walker in PCL, as the macroexpansion isn't needed; however, in terms of
a general code walker (when *walk-form-expand-macros-p* can be set to T)
the ability to macroexpand things is obviously important, and for that a
correct lexical environment needs to be set up.
Cheers,
Christophe
--
http://www-jcsu.jesus.cam.ac.uk/~csr21/ +44 1223 510 299/+44 7729 383 757
(set-pprint-dispatch 'number (lambda (s o) (declare (special b)) (format s b)))
(defvar b "~&Just another Lisp hacker~%") (pprint #36rJesusCollegeCambridge)

Hello,
Christophe Rhodes <csr21@...> writes:
> Hi,
>
> Attached is a patch (thanks to Gerd Moellmann, who pointed me in the
> right direction and pushed me most of the way there :-) that seems to
> fix bug 222 -- Alexey, do you have any other nasty test cases for
> this?
Does Walker augment environment with local functions/variables? May be
MAKE-RESTRICTED-LEXENV should be used somewhere. I'll look at it.
--
Regards,
Alexey Dejneka