Re: CLOS / MOP package name

From: Duane Rettig (duane_at_franz.com)
Date: 02/15/05


Date: 15 Feb 2005 08:41:29 -0800

Bruno Haible <bruno@clisp.org> writes:

> Rob Warnock wrote:
> >| (CLOS:METHOD-FUNCTION method)
> >
> > Note that in CMUCL that needs to be PCL:METHOD-FUNCTION,
>
> Yes, and it's annoying that the implementations don't provide a unique
> package name for their MOP implementation.
>
> Allegro: "CLOS"

Note first that the implementation of the MOP is actually internally
implemented in Allegro's EXCL package, because it is just part of
CLOS and is integrated with the rest of the lisp in our general
implementation package. The package which _exports_ the MOP
interface has CLOS as a nicknme, but its actual name is ACLMOP,
to keep from confiscating any generic names (if done carefully,
users can use rename-package to grab nicknames they want to use
for other purposes). The nicknames for the ACLMOP package are
MOP, CLOS (of course), and ACL-MOP (for back-compatibility; some
don't like hyphens in package names for esthetic reasons).

> GNU clisp: "CLOS"
> LispWorks: "CLOS"

I have no problem with CLOS as a name for MOP functions, and we use
it in Allegro CL for backward compatibility for traditional usages
of MOP functions. However, it is ironic that those CLOS names which
are explicitly specified by ANS cannot be homed in a separate CLOS
package, since they are in the Common Lisp package. In our own
source code, we tend to use MOP as the package identifier, as in
(mop:generic-function-methods #'print-object)

> GNU gcl: "PCL"
> CMUCL: "PCL"
> SBCL: "SB-PCL"

PCL is not CLOS, and that is why through the years we took references
to PCL out of our code, as we tried to work toward more CLOS conformance
and MOP agreement.

> OpenMCL: "OPENMCL-MOP"

This would seem like a good package name if CLOS were added as a
nickname.

> It's time for all implementations to support the name "CLOS" as a nickname,
> at least. Otherwise portable code needs to carry around stuff like this
> eternally:
>
> #-(or CLISP ALLEGRO LISPWORKS)
> (let ((packname
> #+SBCL "SB-PCL" ; or "SB-MOP"?
> #+CMU "PCL" ; or "MOP"?
> #+OpenMCL "OPENMCL-MOP" ; or "CCL" ?
> ))
> #+SBCL (unlock-package packname)
> (rename-package packname packname
> (cons "CLOS" (package-nicknames packname))))

I agree. But why CLOS, and not MOP? CLOS (the system) is already
standardized, and is part of Common Lisp, and the interface functions
mentioned in the standard are mandated to be in the Common Lisp package.
The name MOP more closely reflects the intention of those functions
which are not part of Common Lisp but which align themselves to the
MOP.

-- 
Duane Rettig    duane@franz.com    Franz Inc.  http://www.franz.com/
555 12th St., Suite 1450               http://www.555citycenter.com/
Oakland, Ca. 94607        Phone: (510) 452-2000; Fax: (510) 452-0182   


Relevant Pages

  • Re: CLOS / MOP package name
    ... >> package, since they are in the Common Lisp package. ... the explicit restrictons there are on symbols _contained_ in the Common ... Then nobody could really name a package MOP. ...
    (comp.lang.lisp)
  • Re: diverse MOP packages?
    ... > "CLOS" for LispWorks ... the same for OpenMCL, but i used the 'OPENMCL-MOP' package. ... the current lisa MOP code claims to be a parial copy of some PORT ...
    (comp.lang.lisp)
  • Re: Extending slot definition in ACL 6.2
    ... >>which uses AllegroCL packages EXCL and MOP. ... you are creating methods of a new generic function of the ... I did not spot the package ... with, one without the mop:: package prefix), I knew that was wrong: if ...
    (comp.lang.lisp)
  • Re: CLOS / MOP package name
    ... it is trivial to add nicknames of either flavor. ... Just done this in CLISP. ... So from the perspective of the package ... name "MOP", ...
    (comp.lang.lisp)
  • Re: Cross-lisp questions and my #lisp experience
    ... the functionality is there... ... with a few non-generics that I turned into generics. ... I think that's an important element of the CLOS MOP ...
    (comp.lang.lisp)