From: Xah Lee
Subject: package system in emacs lisp
Date: 
Message-ID: <4ed769a6-a228-468e-8d25-4c7cf641a509@e25g2000prg.googlegroups.com>
In the official emacs lisp manual, node $B!H(BCoding-Conventions$B!I(B
( http://xahlee.org/elisp/Coding-Conventions.html ),
there's this passage:

$B!V(BSince all global variables share the same name space, and all
functions share another name space, you should choose a short word to
distinguish your program from other Lisp programs $B"w(B1. Then take care
to begin the names of all global variables, constants, and functions
in your program with the chosen prefix. This helps avoid name
conflicts.$B!W(B

$B!V(B
$B"w(B1 Footnotes

[1] The benefits of a Common Lisp-style package system are considered
not to outweigh the costs.
$B!W(B

I have a comment and also a question regarding the footnote.

Comment: The sentence is written in a way slightly ambiguous. At
first, i couldn't understand what is meant by that. To be more
precise, the word $B!H(Bconsidered$B!I(B used there can have 2 meanings:

(1) considered = i believed it to be [so and so].

(2) considered = i have thought about it.

So, it was not clear to me, whether the sentence means:

(1) Emacs developmers have thought about XYZ, but believes XYZ's
benefits does not outweight its costs.

(2) Emacs developmers have thought about XYZ, and this consideration
should not outweight its costs.

After a while, i think it means (1).

If so, i suggest this rephrase:

[1] We have considered Common Lisp-style package system, and currently
believes its benefits does not to outweigh the costs.

--------------------

My question is, what is Common Lisp style package system?

i don't quite understand why a package system is so difficult... which
plagues a few languages, e.g. elisp, PHP, Scheme (till recently). As
far as i understand, at the basic level is just a naming convention
for a variable name separator (i.e. $B!H(B.$B!I(B in Java and Python, $B!H(B::$B!I(B in
Perl, $B!H(B`$B!I(B in Mathematica), and also for the compiler to add a prefix
to var names when reading source code from file that declares to be a
package. A more robust solution will deal with $B!H(Bimporting$B!I(B, which
basically means automatically prefix the package name to var/function
names. Am i not right?

  Xah
  ···@xahlee.org
$B-t(B http://xahlee.org/
From: Barry Margolin
Subject: Re: package system in emacs lisp
Date: 
Message-ID: <barmar-0AFDEF.00012306012008@comcast.dca.giganews.com>
In article 
<····································@e25g2000prg.googlegroups.com>,
 Xah Lee <···@xahlee.org> wrote:

> In the official emacs lisp manual, node $B!H(BCoding-Conventions$B!I(B
> ( http://xahlee.org/elisp/Coding-Conventions.html ),
> there's this passage:
> 
> $B!V(BSince all global variables share the same name space, and all
> functions share another name space, you should choose a short word to
> distinguish your program from other Lisp programs $B"w(B1. Then take care
> to begin the names of all global variables, constants, and functions
> in your program with the chosen prefix. This helps avoid name
> conflicts.$B!W(B
> 
> $B!V(B
> $B"w(B1 Footnotes
> 
> [1] The benefits of a Common Lisp-style package system are considered
> not to outweigh the costs.
> $B!W(B
> 
> I have a comment and also a question regarding the footnote.
> 
> Comment: The sentence is written in a way slightly ambiguous. At
> first, i couldn't understand what is meant by that. To be more
> precise, the word $B!H(Bconsidered$B!I(B used there can have 2 meanings:
> 
> (1) considered = i believed it to be [so and so].
> 
> (2) considered = i have thought about it.

I don't see how (2) could be the definition when used in "X are 
considered (not) to Y".  I think that meaning can only apply in a phrase 
like "X are considered".

Are you not a native English speaker?

> So, it was not clear to me, whether the sentence means:
> 
> (1) Emacs developmers have thought about XYZ, but believes XYZ's
> benefits does not outweight its costs.
> 
> (2) Emacs developmers have thought about XYZ, and this consideration
> should not outweight its costs.
> 
> After a while, i think it means (1).

Seems obvious to me.  I'm not even sure what your interpretation (2) 
means.  What does it mean for "thinking about" something to outweigh its 
costs?

> 
> If so, i suggest this rephrase:
> 
> [1] We have considered Common Lisp-style package system, and currently
> believes its benefits does not to outweigh the costs.
> 
> --------------------
> 
> My question is, what is Common Lisp style package system?
> 
> i don't quite understand why a package system is so difficult... which
> plagues a few languages, e.g. elisp, PHP, Scheme (till recently). As
> far as i understand, at the basic level is just a naming convention
> for a variable name separator (i.e. $B!H(B.$B!I(B in Java and Python, $B!H(B::$B!I(B in
> Perl, $B!H(B`$B!I(B in Mathematica), and also for the compiler to add a prefix
> to var names when reading source code from file that declares to be a
> package. A more robust solution will deal with $B!H(Bimporting$B!I(B, which
> basically means automatically prefix the package name to var/function
> names. Am i not right?

Many CL programmers find the package system confusing.  One problem many 
of them have is that they expect it to do more than it does -- they 
assume it's a module system because that's what they really want.  The 
inheritance mechanism and shadowing feature can be tricky.  Order of 
compilation and loading matter.

It's more than just a naming convention, because of things like 
USE-PACKAGE and IMPORT.

-- 
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***