emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: is requiring cl bad?


From: Helmut Eller
Subject: Re: is requiring cl bad?
Date: Fri, 21 Dec 2012 10:24:04 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

On Fri, Dec 21 2012, David De La Harpe Golden wrote:

> On 20/12/12 09:16, Helmut Eller wrote:
>
>> Have you actually taken a "hard look" at Ron Garret's lexicons?
>> What  was your experience?  I played with them a few years back, but I 
>> quickly
>> concluded that lexicons are only a crude prototype
>
> Well, the last version I looked much at was ~2.0 when he started to
> reuse packages extensively as part of the underlying implementation
> (something I disliked actually [1], but he saw lexicons as a complete
> replacement for packages, I remember in the CL case I would have
> preferred if they had been independent facilities (but my concerns
> about packages vs. lexicons in the CL cases /would not apply/ here in
> emacs land, because there are no packages))

Emacs symbols may not have packages but (funcall '<some-symbol>) is used
a lot in Emacs Lisp.  AFAICS, modules based on lexical scoping don't
handle this case, because funcall doesn't resolve the symbol to a module
binding.  Which module should be used at runtime?

>> and that it was never used in the "field"; not something I
>> would use.
>
> Not exactly mature, no - but hey, was new, shrug.  Anyway, there's
> presumably no way at his /implementation/ could be reused for emacs
> unless emacs was first made into a common lisp.
>
> However, I mentioned lexicons as something to look at for inspiration
> for a hypothetical emacs system: the quality of Ron's actual
> implementation for [C]CL is not of particular concern for that
> purpose, in fact you could avoid looking at it completely (though it
> appears to be liberally licensed) and just read the paper for that
> purpose.

Some ideas look nice on paper but when used in practice all sorts of
problems appear that aren't covered in the paper.  IMO lexicons fall
into that category.

>>> Emacs lisp is lexically scoped now after all.
>>
>> If you want Scheme-like modules based on lexical scoping you will also
>> need hygienic macros.  (Something that Common Lisp nicely avoids.)
>>
>
> Ron actually presented lexicons plus an escaping hack as an
> /alternative/ to scheme-style hygienic macros in his paper, mind, you
> may or may not be convinced that's better than a hygienic macro DSL,
> not sure I was.

Either way you need to resolve a symbol to the module binding.  So the
result of a macro must either contain the resolved binding (if you do
the resolution early) or the symbol plus the module (in some way) to
that the compiler can do the resolution.

> I figure implementation innards would need amendment regardless in the
> emacs case, practically if not in theory (I didn't mean to suggest
> lexicons be built on top of existing facilities at a purely lisp level
> or something in the emacs case, whereas despite CCL-isms, Ron used
> mostly portable CL)

I would not call this "mostly portable" because the compiler patch is
crucial and it was not even portable to the next version of the
compiler.

Helmut




reply via email to

[Prev in Thread] Current Thread [Next in Thread]