scope of variables

Vlad Dumitrescu vladdu55@REDACTED
Mon Sep 4 09:09:15 CEST 2006


On 9/4/06, karol skocik <karol.skocik@REDACTED> wrote:
> Hi guys,
>  do you know if there is some intelligent way to simulate scope in erlang?
>
> I want to play and create something like lisp layer over erlang syntax
> tree, which would allow macros similar to those in common lisp, but
> erlang's crazy scoping is standing in the way...

Hi,

I am working on a meta-programming facility for Erlang, that in the
end will allow even Lisp-like macros, so I know exactly what you mean
:-)

This isn't really easy in Lisp either, if you look at the
implementation. I mean, behind the scenes the variables are being
renamed using gensym so as to avoid the problem.

The only way I did find to be able to handle this is to make the
parser and compiler aware of these issues and do the work there. I
don't think it's possible to "just" add a layer above erl-core, but
I'd love to be proved wrong !

best regards,
Vlad



More information about the erlang-questions mailing list