Re: Glasgow haskell vs. Lispworks
- From: Joachim Durchholz <jo@xxxxxxxxxxxxx>
- Date: Tue, 14 Aug 2007 09:24:58 +0200
Rainer Joswig schrieb:
* "foo" and "foo", same strings ?
are these really the same objects?
That depends on whether you want equality or identity.
Observationally, A is identical to B if both are equal and remain equal under any change to A. If I can't change A, equality implies identity; since identity implies equality by definition, identity and equality are equivalent under immutability.
So in a pure language, identity is the same as equality.
* "foo" and "foo", same contents ?
It could be different string types (fixed length, growing strings,
unicode strings, ascii strings, ...)
They couldn't (in Haskell).
* "foo" and "Foo", same word?
* "Rainer Joswig" and "Ranier Joswig", same name (minus spelling)?
You work with equivalence classes in such a case.
I.e. either you write a function that maps "same modulo whatever" to equal values, and compare the results.
Or you write a "fuzzy" equality comparison function.
The language semantics remains unaffected.
Regards,
Jo
.
- Follow-Ups:
- Re: Glasgow haskell vs. Lispworks
- From: Jon Harrop
- Re: Glasgow haskell vs. Lispworks
- From: Ole Nielsby
- Re: Glasgow haskell vs. Lispworks
- References:
- Glasgow haskell vs. Lispworks
- From: Rene de Visser
- Re: Glasgow haskell vs. Lispworks
- From: Rainer Joswig
- Re: Glasgow haskell vs. Lispworks
- From: Stuart Cook
- Re: Glasgow haskell vs. Lispworks
- From: Rainer Joswig
- Re: Glasgow haskell vs. Lispworks
- From: rossberg
- Re: Glasgow haskell vs. Lispworks
- From: Rainer Joswig
- Glasgow haskell vs. Lispworks
- Prev by Date: Re: Sweeney presentation "The Next Mainstream Language"
- Next by Date: Re: Glasgow haskell vs. Lispworks
- Previous by thread: Re: Glasgow haskell vs. Lispworks
- Next by thread: Re: Glasgow haskell vs. Lispworks
- Index(es):
Relevant Pages
|