Lisp HUG Maillist Archive

harlequin-common-lisp:augment-environment for LW 5.0?

I'm trying to port Arnesi to LW 5.0.

Few obstacles here and there - I've gotten it down to where there's
one in my way I can't solve:

I'm guessing that Arnesi was originally meant to be compatible with a
pre-5.0 Lispworks.

I cannot find or figure out a replacement for
 harlequin-common-lisp:augment-environment

I ask here, and not on the dev list for the project, as while this is
an external library, the issue involves up-to-date lispworks details.



Context:



(defmethod augment-with-variable ((env lexical::environment) var)
  (harlequin-common-lisp:augment-environment
   env :variable (list var)))


(defmethod augment-with-function ((env lexical::environment) fun)
  (harlequin-common-lisp:augment-environment
   env :function (list fun)))


(defmethod augment-with-macro ((env lexical::environment) mac def)
  (harlequin-common-lisp:augment-environment
   env :macro (list (list mac def))))


(defmethod augment-with-symbol-macro ((env lexical::environment) symmac def)
  (harlequin-common-lisp:augment-environment
   env :symbol-macro (list (list symmac def))))




Thanks,
Matt


Re: harlequin-common-lisp:augment-environment for LW 5.0?

Hi

Matthew asked this in 2007.   Any news on this front?
Without the CLtL2 environment functions there is little hope of  
writing portable walkers.

Cheers
--
Marco




On May 25, 2007, at 06:09 , Matthew Lamari wrote:

>
> I'm trying to port Arnesi to LW 5.0.
>
> Few obstacles here and there - I've gotten it down to where there's
> one in my way I can't solve:
>
> I'm guessing that Arnesi was originally meant to be compatible with a
> pre-5.0 Lispworks.
>
> I cannot find or figure out a replacement for
> harlequin-common-lisp:augment-environment
>
> I ask here, and not on the dev list for the project, as while this is
> an external library, the issue involves up-to-date lispworks details.
>
>
>
> Context:
>
>
>
> (defmethod augment-with-variable ((env lexical::environment) var)
> (harlequin-common-lisp:augment-environment
>  env :variable (list var)))
>
>
> (defmethod augment-with-function ((env lexical::environment) fun)
> (harlequin-common-lisp:augment-environment
>  env :function (list fun)))
>
>
> (defmethod augment-with-macro ((env lexical::environment) mac def)
> (harlequin-common-lisp:augment-environment
>  env :macro (list (list mac def))))
>
>
> (defmethod augment-with-symbol-macro ((env lexical::environment)  
> symmac def)
> (harlequin-common-lisp:augment-environment
>  env :symbol-macro (list (list symmac def))))
>
>
>
>
> Thanks,
> Matt
>

--
Marco Antoniotti



Re: harlequin-common-lisp:augment-environment for LW 5.0?

On Mon, Mar 16, 2009 at 9:50 AM, Marco Antoniotti <marcoxa@cs.nyu.edu> wrote:
> I may not have understood your code completely, but I think it is not a
> substitute when you are dealing with third party code.  How do you ensure
> that somebody doing a
>
>        (defmacro foo (...) ...)
>
> will record the information in the %info% place?

Yeah, a concrete example is type information. Imagine you have a
(compiler) macro that could heavily optimize the case where some
argument is of a certain type or its numeric value within a certain
range. Environment access could give you the type information of your
own declarations, but also any declarations in third-party code. So a
uniform interface is good.

But if you are the only producer and consumer of the declaration
information, the method Pascal showed is fine. In CLPython I need to
keep track of lexical Python-specific state during compilation. I use
Pascal's method there in all Lisp implementation except for Allegro
CL, as the latter lets you define your own declaration type using
sys:define-declaration, so you can use regular (declare ..) to stuff
information in the environment, and get that out again using
sys:declaration-information.

As I've said before, it would be great if Lispworks provided an
interface similar to Allegro's.

- Willem


Updated at: 2020-12-10 08:45 UTC