[Seaside-dev] When is Symbol>>#= not Symbol>>#==?
John O'Keefe
wembley.instantiations at gmail.com
Thu Nov 13 20:06:27 UTC 2008
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside-dev/attachments/20081113/ee8721de/attachment.htm
More information about the seaside-dev
mailing list