To make String and Symbol ANSI compliant regarding #=

R. A. Harmon harmonra at webname.com
Sun Apr 16 19:39:21 UTC 2000


At 01:40 AM 4/16/00 +0200, Stephan Rudlof wrote:
>Dear Squeakers,
>
>currently (2.7) we have
>	'foo' = #foo -> true
>	#foo = 'foo' -> false
>.
>Last suggestions of me and Dan ensure symmetry for comparison of Symbols
>and Strings, but not ANSI compliance.
>Symmetry is a must, IMNSHO. What about ANSI compliance?
>
>I think this is a serious compatibility problem, not just an academic
>discussion.
>
>
>To make String and Symbol ANSI compliant
>========================================
>
>First variant:
>------------------
>
>(1) make
>	'foo' = #foo -> false
>(symmetry leads to same result for #foo = 'foo' automagically then) by
>
>- changing SequenceableCollection>>= to be conformant to protocol
><sequencedReadableCollection>,
>- removing #= from String (semantically, means it has to be the same
>result as SequenceableCollection>>=).

An error on my part.  Change species to class instead.


>
>Both changes were suggested by Richard.
>
>
>(2) check code for all potential (!) occurences of the case
>	'foo' = #foo
>(true so far, but not after ANSI) then and rework it -> difficult for
>vars!
>
>
>
>Second variant:
>-------------------
>
>Changing the ANSI standard: it is a draft! Or is it official now?

It is official now.  Change the standard might be a tough sell as my
proposed changes do bring the following Squeak results in line with those of
Dolphin 3.0 and VWNC 3.0:

	'abc' sameAs: 'ABC'		"-> true"
	'abc' = 'ABC'			"-> false"
	#'abc' = 'abc'			"-> false"
	'abc' = #'abc'			"-> false"
	'abc' sameAs: #'abc'		"-> true"
	#'abc' sameAs: 'abc'		"-> true"

        *** Note I used the ANSI syntax for symbol literal #'aSymbol'
                not the ANSI syntax for selector literal #aSelector



>Do we want to have ANSI compliance at all?

My selfish answer?  YES!!!!!

I think there is a long list of advantages ANSI compliance would bring to
Squeak.


>Do we want to have ANSI compliance here?
[snip]

I think the choice of sort of ANSI compliance is problematic.  What is
compliant enough?  I guess I think of it as ANSI compliant or not.  I'm not
sure what sort of buys you.

--
Richard A. Harmon          "The only good zombie is a dead zombie"
harmonra at webname.com           E. G. McCarthy
Spencer, Iowa





More information about the Squeak-dev mailing list