ES4 draft: Name

Mark S. Miller erights at
Fri Mar 21 16:57:16 PDT 2008

On Fri, Mar 21, 2008 at 2:14 PM, Waldemar Horwat <waldemar at> wrote:
> Mark S. Miller wrote:
>  > The one use-case I can see for names and namespaces that isn't
>  > addressed adequately by existing patterns is expanding the
>  > property-name-space, [...] (The T variant of Scheme is the only example I know
>  > where first-class selectors saw significant use. Though widely
>  > admired, no other Scheme or Lisp variants picked up on this feature.)
>  Really?  Lisp is a great example of the benefit of namespaces.  Namespaces are essential to Common Lisp.  In my Netscape days I wrote the semantic engine for the reference implementation of ES4 in Common Lisp.  Lisp namespaces were crucial to maintaining my sanity while structuring that program.

I'd forgotten about the Common Lisp package system. Unlike T and
Smalltalk, Common Lisp doesn't really have objects with selector-based
method dispatch. Instead, they overload a multimethod on the types of
its arguments. The parts of a multimethod are gathered together in a
strange fashion. But, IIUC, once gathered, a multimethod is looked
like any lexical definition -- by looking up a textual identifier in a
package to get a symbol, and then looking that symbol up in the normal
lexical environment to get a location. I consider that to be an
example of my previously explained use case: using an extra level of
indirection prior to lexical environment lookup. This is an example of
the package-like use case about which I wrote:

> I think
> the current JavaScript practice --- of using lexical scoping, objects
> as records, package naming paths as dotted paths through records
> (e.g., Dojo & YUI) --- addresses most of these needs by patterns
> expressed using more basic primitives.

Multimethods do blur the line between lexical name lookup and
selector-based method dispatch. This line is blurry enough that Common
Lisp may indeed be an example or a counter-example, depending on how
one regards their package system and their object system. Whereas
Scheme was easily subset into the object capability language W7
<>, attempts to secure Common
Lisp went nowhere. My sense has been
<> that
Common Lisp's package system and its multimethod-based object system
were the main impediments.


More information about the Es4-discuss mailing list