[Seaside-dev] When is Symbol>>#= not Symbol>>#==?

Lukas Renggli renggli at gmail.com
Thu Nov 13 23:10:20 UTC 2008


Thank you for fixing the test. I was not paying attention to that when
writing this.

Wouldn't it be simpler if the JSON parser would parse everything as a
string and not convert certain values to a symbol? This would also
avoid the need for these ugly #== comparisons.

Cheers,
Lukas

On Thu, Nov 13, 2008 at 9:06 PM, John O'Keefe
<wembley.instantiations at gmail.com> wrote:
> On Thu, Nov 13, 2008 at 2:44 PM, Philippe Marschall
> <philippe.marschall at gmail.com> wrote:
>>
>> 2008/11/13, John O'Keefe <wembley.instantiations at gmail.com>:
>> > I have been getting failures in my port of the JSJson tests (example,
>> > self
>> > assert: (self parse: 'True') = 'True').  These failures were a bit of a
>> > mystery to me since on VA Smalltalk "self parse: 'True'" answers a
>> > Symbol,
>> > not a String.  But on delving into Squeak, all is now clear -- it
>> > answers a
>> > Symbol there also!
>>
>> That looks like a bug in the test or in the Squeak implementation. The
>> Seaside coding conventions are quite clear in this area, you can't
>> assume that a Symbol is a String. So either the test or the Squeak
>> implementation is broken.
>>
>> It probably couldn't hurt to document the type assumptions along the lines
>> of:
>>
>> assert: (self parse: 'True') class = #True class
>>
>> or:
>>
>> assert: (self parse: 'True') isSymbol
>>
>> Cheers
>> Philippe
>> _______________________________________________
>> seaside-dev mailing list
>> seaside-dev at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
>
> I think I'll go with an identity test for the tests that should answer a
> Symbol:
>
>  assert: (self parse: 'True') == #True
>
> That will defeat the odd equality implementation on Squeak.
>
> John
> _______________________________________________
> seaside-dev mailing list
> seaside-dev at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
>
>



-- 
Lukas Renggli
http://www.lukas-renggli.ch


More information about the seaside-dev mailing list