From: Kenny Tilton
Subject: acl keyword package nickname weirdness
Date: 
Message-ID: <wj2Fc.42015$a92.23548@twister.nyc.rr.com>
AllegroCL:
(package-nicknames (find-package :keyword)) => ("")

Lispworks:
(package-nicknames (find-package :keyword)) => nil

Whassup with ACL? Any rationale for that?

kt

-- 
Home? http://tilton-technology.com
Cells? http://www.common-lisp.net/project/cells/
Cello? http://www.common-lisp.net/project/cello/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
Your Project Here! http://alu.cliki.net/Industry%20Application

From: Barry Margolin
Subject: Re: acl keyword package nickname weirdness
Date: 
Message-ID: <barmar-AA8927.23000701072004@comcast.dca.giganews.com>
In article <·····················@twister.nyc.rr.com>,
 Kenny Tilton <·······@nyc.rr.com> wrote:

> AllegroCL:
> (package-nicknames (find-package :keyword)) => ("")
> 
> Lispworks:
> (package-nicknames (find-package :keyword)) => nil
> 
> Whassup with ACL? Any rationale for that?

It simplifies parsing keywords.  Given a token like :FOO, it splits it 
into the parts before and after the colon, which are "" and "FOO" 
respectively.  Then it does (find-package <part-before>), which expects 
it to be the name or nickname of a package.  Giving the keyword package 
a nickname of "" means that it doesn't have to be treated as a special 
case by the parser.

-- 
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
From: Kenny Tilton
Subject: Re: acl keyword package nickname weirdness
Date: 
Message-ID: <Kq5Fc.15449$4h7.1696917@twister.nyc.rr.com>
Barry Margolin wrote:
> In article <·····················@twister.nyc.rr.com>,
>  Kenny Tilton <·······@nyc.rr.com> wrote:
> 
> 
>>AllegroCL:
>>(package-nicknames (find-package :keyword)) => ("")
>>
>>Lispworks:
>>(package-nicknames (find-package :keyword)) => nil
>>
>>Whassup with ACL? Any rationale for that?
> 
> 
> It simplifies parsing keywords.  Given a token like :FOO, it splits it 
> into the parts before and after the colon, which are "" and "FOO" 
> respectively.  Then it does (find-package <part-before>), which expects 
> it to be the name or nickname of a package.  Giving the keyword package 
> a nickname of "" means that it doesn't have to be treated as a special 
> case by the parser.
> 

thx for the explanation. yecch. i hate that kind of cutesy code. case in 
point: while ripping off the ACL apropos dialog I had code to display 
the package of a symbol:

(or (car (package-nicknames pkg))
     (package-name pkg))

looks good, right? nope. for any keyword, => ""

kt

-- 
Home? http://tilton-technology.com
Cells? http://www.common-lisp.net/project/cells/
Cello? http://www.common-lisp.net/project/cello/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
Your Project Here! http://alu.cliki.net/Industry%20Application
From: Dave Pearson
Subject: Re: acl keyword package nickname weirdness
Date: 
Message-ID: <slrncea1q9.65q.davep.news@hagbard.davep.org>
* Kenny Tilton <·······@nyc.rr.com>:

> thx for the explanation. yecch. i hate that kind of cutesy code. case in
> point: while ripping off the ACL apropos dialog I had code to display the
> package of a symbol:
> 
> (or (car (package-nicknames pkg))
>      (package-name pkg))
> 
> looks good, right? nope. for any keyword, => ""

Assuming that the above code is hoping to pick the smallest name for a
package (mostly 'cos I had exactly the same code in a couple of CL init
files for displaying a nice-ish prompt in the REPL) then it's probably nice
until you meet a package where the car of the nicknames is longer than the
package name or any of the other nicknames.

I ended up sorting the lot (name and nicknames) on length and picking the
shortest. While it's not perfect that might at least give you the point
where you can filter out empty nicknames.

-- 
Dave Pearson
http://www.davep.org/lisp/
From: Christophe Rhodes
Subject: Re: acl keyword package nickname weirdness
Date: 
Message-ID: <sqr7ruj26f.fsf@cam.ac.uk>
Barry Margolin <······@alum.mit.edu> writes:

> In article <·····················@twister.nyc.rr.com>,
>  Kenny Tilton <·······@nyc.rr.com> wrote:
>
>> Whassup with ACL? Any rationale for that?
>
> It simplifies parsing keywords.  Given a token like :FOO, it splits it 
> into the parts before and after the colon, which are "" and "FOO" 
> respectively.  Then it does (find-package <part-before>), which expects 
> it to be the name or nickname of a package.  Giving the keyword package 
> a nickname of "" means that it doesn't have to be treated as a special 
> case by the parser.

But it also changes the parse of tokens like ||:FOO, which I think
it's harder to argue that intentional.

CHristophe
-- 
http://www-jcsu.jesus.cam.ac.uk/~csr21/       +44 1223 510 299/+44 7729 383 757
(set-pprint-dispatch 'number (lambda (s o) (declare (special b)) (format s b)))
(defvar b "~&Just another Lisp hacker~%")    (pprint #36rJesusCollegeCambridge)
From: Rob Warnock
Subject: Re: acl keyword package nickname weirdness
Date: 
Message-ID: <VoqdnTrGB8GU23jdRVn-jg@speakeasy.net>
Christophe Rhodes  <·····@cam.ac.uk> wrote:
+---------------
| Barry Margolin <······@alum.mit.edu> writes:
| >  Kenny Tilton <·······@nyc.rr.com> wrote:
| >> Whassup with ACL? Any rationale for that?
| >
| > It simplifies parsing keywords.  Given a token like :FOO, it splits it 
| > into the parts before and after the colon, which are "" and "FOO" 
| > respectively.  Then it does (find-package <part-before>), which expects 
| > it to be the name or nickname of a package.  Giving the keyword package 
| > a nickname of "" means that it doesn't have to be treated as a special 
| > case by the parser.
| 
| But it also changes the parse of tokens like ||:FOO, which I think
| it's harder to argue that intentional.
+---------------

Note that CMUCL-18e behaves like ACL in this regard:

	> (find-package nil)

	NIL
	> (find-package "")

	#<The KEYWORD package, 0/2 internal, 1701/2061 external>
	> (package-nicknames *)

	("")
	> '||:FOO

	:FOO
	> (symbol-package '||:FOO)

	#<The KEYWORD package, 0/2 internal, 1702/2061 external>
	> 


-Rob

-----
Rob Warnock			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607
From: Christophe Rhodes
Subject: Re: acl keyword package nickname weirdness
Date: 
Message-ID: <sqvfh6j28z.fsf@cam.ac.uk>
Kenny Tilton <·······@nyc.rr.com> writes:

> AllegroCL:
> (package-nicknames (find-package :keyword)) => ("")
>
> Lispworks:
> (package-nicknames (find-package :keyword)) => nil
>
> Whassup with ACL? Any rationale for that?

It's (most probably) a bug in ACL: see CLHS 11.1.2.  (Check your
friendly beta program for whether it's been fixed for 7.0)

Christophe
-- 
http://www-jcsu.jesus.cam.ac.uk/~csr21/       +44 1223 510 299/+44 7729 383 757
(set-pprint-dispatch 'number (lambda (s o) (declare (special b)) (format s b)))
(defvar b "~&Just another Lisp hacker~%")    (pprint #36rJesusCollegeCambridge)