[Top][All Lists]

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

Re: is requiring cl bad?

From: David De La Harpe Golden
Subject: Re: is requiring cl bad?
Date: Thu, 20 Dec 2012 04:46:41 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20121122 Icedove/10.0.11

On 17/12/12 19:09, Pascal J. Bourguignon wrote:
24.3 finally provides an alternative: `cl-lib' which offers the
same functionality but in a namespace-clean way (i.e. using a "cl-"
prefix everywhere).

This is a silly solution.
The right solution is to implement a package system.

The consistent-prefix approach may be a C-like solution, but is still noticeably better than the previous conflicty mess, and widely
used for other emacs lisp libs.

But regarding the idea of "a package system" in particular, as you may mean a system similar to common lisp "packages":

If emacs ever did go toward adding new facilities in the general area of modularity (however unlikely it is in reality in the near future), I reckon Ron Garret's common lisp land "lexicons" work [1] might be a better "lispy modularity thingy" for emacs lisp to be inspired by than common lisp packages in particular. At least, I'd take a hard look at lexicons (and at least glance at what some other languages do), before just blindly adding common lisp style packages.

Emacs lisp is lexically scoped now after all.

To people coming from quite a few other languages with more [nowadays-]conventional module systems, lexicons might well seem less weird than packages.

In emacs lisp land there is obviously no prior usage of common lisp style packages in the first place (yes I am vaguely aware you can feck about with non-default obarrays in emacs lisp for some purposes, but meh), unlike the situation in common lisp land where inertia and compat concerns will probably keep most people on packages anyway despite the existence of lexicons there now.

[1] http://www.flownet.com/ron/lisp/lexicons.pdf
Lexicons are first-class global lexical environments, what are sometimes called "modules" or "namespaces" in other languages.
instead of mapping strings to symbols, lexicons map symbols to (global) bindings.

reply via email to

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