From: Mirko
Subject: (eql "foo" "foo") clisp vs hyperspec
Date: 
Message-ID: <383d6fdb-67b4-4f74-a06c-fbdf2676b017@s24g2000vbp.googlegroups.com>
Hello,

For (eql "foo" "foo") hyperspec says true but clisp (2.46 on windows
+cygwin) says nil.  (I tried clisp with maximum ansi compliance as
well)

My reading of Seibel's Practical Common Lisp (Ch. 4, p. 47) suggests
nil.

I did not find anything in the hyperspec errata.

Who is right?

Thanks,

Mirko

From: ··················@gmail.com
Subject: Re: (eql "foo" "foo") clisp vs hyperspec
Date: 
Message-ID: <8c95054c-cb0e-4219-b916-2b6895eeaf33@f40g2000pri.googlegroups.com>
"The eql predicate is true if its arguments are eq, or if they are
numbers of the same type with the same value, or if they are character
objects that represent the same character."

you are looking for equal, which identifies isomorphic objects
From: Mirko
Subject: Re: (eql "foo" "foo") clisp vs hyperspec
Date: 
Message-ID: <a3ee6218-8677-4d6b-9b67-ffd49a574227@g38g2000yqd.googlegroups.com>
On Dec 15, 3:31 pm, ··················@gmail.com wrote:
> "The eql predicate is true if its arguments are eq, or if they are
> numbers of the same type with the same value, or if they are character
> objects that represent the same character."
>
> you are looking for equal, which identifies isomorphic objects

Yep, I knew about e`qual'.  I got there by way of `eql'.

I was not clear, (nor careful) enough about hyperspec.  Here is the
example from hyperspec under eql:

(eql "Foo" "Foo")
=>  true
OR=>  false

Which one?
From: Barry Margolin
Subject: Re: (eql "foo" "foo") clisp vs hyperspec
Date: 
Message-ID: <barmar-ECDCAA.20154315122008@mara100-84.onlink.net>
In article 
<····································@g38g2000yqd.googlegroups.com>,
 Mirko <·············@gmail.com> wrote:

> On Dec 15, 3:31�pm, ··················@gmail.com wrote:
> > "The eql predicate is true if its arguments are eq, or if they are
> > numbers of the same type with the same value, or if they are character
> > objects that represent the same character."
> >
> > you are looking for equal, which identifies isomorphic objects
> 
> Yep, I knew about e`qual'.  I got there by way of `eql'.
> 
> I was not clear, (nor careful) enough about hyperspec.  Here is the
> example from hyperspec under eql:
> 
> (eql "Foo" "Foo")
> =>  true
> OR=>  false
> 
> Which one?

It's implementation-dependent, and likely even context-dependent.  The 
compiler is allowed to coalesce constants, making all the "Foo" literals 
within a compilation unit be EQL to each other.  But it's not required 
to do this, so it could keep them distinct like the reader does.

If the implementation's REPL compiles the expression before executing 
it, it might coalesce the constants, resulting in true.

-- 
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 ***
From: Pascal J. Bourguignon
Subject: Re: (eql "foo" "foo") clisp vs hyperspec
Date: 
Message-ID: <7cskoobeb1.fsf@pbourguignon.anevia.com>
Mirko <·············@gmail.com> writes:

> On Dec 15, 3:31�pm, ··················@gmail.com wrote:
>> "The eql predicate is true if its arguments are eq, or if they are
>> numbers of the same type with the same value, or if they are character
>> objects that represent the same character."
>>
>> you are looking for equal, which identifies isomorphic objects
>
> Yep, I knew about e`qual'.  I got there by way of `eql'.
>
> I was not clear, (nor careful) enough about hyperspec.  Here is the
> example from hyperspec under eql:
>
> (eql "Foo" "Foo")
> =>  true
> OR=>  false
>
> Which one?

For this specific form, Barry answered.


Notice that:

(eql #1="Foo" #1#) --> true
(let ((f "Foo")) (eql f f)) --> true
(let ((f "Foo") (g (copy-string "Foo"))) (eql f g)) --> NIL

What CLHS says here, is that reading "Foo" twice may or may not give the same object.

With the reader macros #= and  ##, we can ensure that the same object
is used in several places in the s-exp read.  But in general you will
have your string objects bound to variables, and you will pass the
values bound to variables to EQL, so you get determinately true or NIL
depending on whether you give twice the same string object or not.

-- 
__Pascal Bourguignon__
From: stassats
Subject: Re: (eql "foo" "foo") clisp vs hyperspec
Date: 
Message-ID: <04038fc0-81bf-4dda-a5fc-1428ba8b2f2e@t39g2000prh.googlegroups.com>
On Dec 15, 10:55 pm, Mirko <·············@gmail.com> wrote:
> Hello,
>
> For (eql "foo" "foo") hyperspec says true but clisp (2.46 on windows
> +cygwin) says nil.  (I tried clisp with maximum ansi compliance as
> well)

Where does it say so?

My hyperspec says:
 (eql "Foo" "Foo")
=>  true
OR=>  false

Note that "OR".
From: Rainer Joswig
Subject: Re: (eql "foo" "foo") clisp vs hyperspec
Date: 
Message-ID: <joswig-CF872A.21403015122008@news-europe.giganews.com>
In article 
<····································@s24g2000vbp.googlegroups.com>,
 Mirko <·············@gmail.com> wrote:

> Hello,
> 
> For (eql "foo" "foo") hyperspec says true but clisp (2.46 on windows
> +cygwin) says nil.  (I tried clisp with maximum ansi compliance as
> well)
> 

If you look at the Hyperspec it says in the examples:

 (eql "Foo" "Foo") =>  true OR =>  false


See the 'OR'?


If it is the same one string, EQL returns t.
If they are different string objects, but with the same
characters, it is nil.


> My reading of Seibel's Practical Common Lisp (Ch. 4, p. 47) suggests
> nil.
> 
> I did not find anything in the hyperspec errata.
> 
> Who is right?
> 
> Thanks,
> 
> Mirko

-- 
http://lispm.dyndns.org/
From: Mirko
Subject: Re: (eql "foo" "foo") clisp vs hyperspec
Date: 
Message-ID: <7ec0fbd9-4bd3-4ec2-8eae-bcb761229d8e@a26g2000prf.googlegroups.com>
On Dec 15, 3:40 pm, Rainer Joswig <······@lisp.de> wrote:
> In article
> <····································@s24g2000vbp.googlegroups.com>,
>
>  Mirko <·············@gmail.com> wrote:
> > Hello,
>
> > For (eql "foo" "foo") hyperspec says true but clisp (2.46 on windows
> > +cygwin) says nil.  (I tried clisp with maximum ansi compliance as
> > well)
>
> If you look at the Hyperspec it says in the examples:
>
>  (eql "Foo" "Foo") =>  true OR =>  false
>
> See the 'OR'?
>
> If it is the same one string, EQL returns t.
> If they are different string objects, but with the same
> characters, it is nil.
>
> > My reading of Seibel's Practical Common Lisp (Ch. 4, p. 47) suggests
> > nil.
>
> > I did not find anything in the hyperspec errata.
>
> > Who is right?
>
> > Thanks,
>
> > Mirko
>
> --http://lispm.dyndns.org/

Thanks for the clarification.

Mirko
From: Alex Mizrahi
Subject: Re: (eql "foo" "foo") clisp vs hyperspec
Date: 
Message-ID: <4947bef2$0$90276$14726298@news.sunsite.dk>
 M> I did not find anything in the hyperspec errata.

JFYI, hyperspecs examples are not normative, they are just illustrations.
in some cases hyperspec examples are incorrect. not in this case, though.