From: Jeff M.
Subject: Understanding type symbols
Date: 
Message-ID: <1100100143.189430.271780@f14g2000cwb.googlegroups.com>
I'm sure that this is a "special case" senario, but recently with the
BNF parser I wrote, one of the (common) pitfalls I came across was
calling one of my functions (in package A) from a different package
(B). And of course, EQ will fail...

(eq 'a::foo 'b::boo) => NIL

However, when typing up an example program for a friend recently, I
ended up using TYPECASE in there, and it hit me "wouldn't this fail
given the proper context that it was used in?

Well, this morning I came in, launched LispWorks and did:

(eq 'a::fixnum 'b::fixnum) => T

What the? Special... case... needs... clarification... ;)

Thanks!
Jeff M.
PS. checking to see if this is in Peter's or Graham's books anywhere

From: Matthew Danish
Subject: Re: Understanding type symbols
Date: 
Message-ID: <87r7n1raap.fsf@mapcar.org>
"Jeff M." <·······@gmail.com> writes:
> I'm sure that this is a "special case" senario, but recently with the
> BNF parser I wrote, one of the (common) pitfalls I came across was
> calling one of my functions (in package A) from a different package
> (B). And of course, EQ will fail...
> 
> (eq 'a::foo 'b::boo) => NIL
> 
> However, when typing up an example program for a friend recently, I
> ended up using TYPECASE in there, and it hit me "wouldn't this fail
> given the proper context that it was used in?
> 
> Well, this morning I came in, launched LispWorks and did:
> 
> (eq 'a::fixnum 'b::fixnum) => T
> 
> What the? Special... case... needs... clarification... ;)

FIXNUM is being imported from the CL package by A and by B; hence it
is the same symbol.  (eq 'a::fixnum 'cl:fixnum) and 
(eq 'b::fixnum 'cl:fixnum).

-- 
;; Matthew Danish -- user: mrd domain: cmu.edu
;; OpenPGP public key: C24B6010 on keyring.debian.org
From: Svein Ove Aas
Subject: Re: Understanding type symbols
Date: 
Message-ID: <cmtbvv$s00$1@services.kq.no>
Jeff M. wrote:

> I'm sure that this is a "special case" senario, but recently with the
> BNF parser I wrote, one of the (common) pitfalls I came across was
> calling one of my functions (in package A) from a different package
> (B). And of course, EQ will fail...
> 
> (eq 'a::foo 'b::boo) => NIL
> 
> However, when typing up an example program for a friend recently, I
> ended up using TYPECASE in there, and it hit me "wouldn't this fail
> given the proper context that it was used in?
> 
> Well, this morning I came in, launched LispWorks and did:
> 
> (eq 'a::fixnum 'b::fixnum) => T
> 
> What the? Special... case... needs... clarification... ;)
> 
No special case here, I suspect.
The fixnum symbol is external to the common-lisp package, so if both
packages use it then it'll be the same symbol - thus, eq. 
From: Jeff M.
Subject: Re: Understanding type symbols
Date: 
Message-ID: <1100100739.362365.161620@z14g2000cwz.googlegroups.com>
Ah, that would make sense, and be simple enough. Thanks.
Jeff M.
- Learn something new, every day...
From: David Sletten
Subject: Re: Understanding type symbols
Date: 
Message-ID: <nrskd.40684$jo2.13588@twister.socal.rr.com>
Jeff M. wrote:

> I'm sure that this is a "special case" senario, but recently with the
> BNF parser I wrote, one of the (common) pitfalls I came across was
> calling one of my functions (in package A) from a different package
> (B). And of course, EQ will fail...
> 
> (eq 'a::foo 'b::boo) => NIL
> 
By the way, I know that you're just experimenting above, but you 
shouldn't get in the habit of using symbols such as A::FOO, right? The 
double colon indicates that FOO is internal to package A and thus 
'private'. If FOO has been exported, and you can access it as A:FOO, 
then you're all right.

David Sletten