[Seaside-dev] Seaside-Core-jok.482.mcz
John O'Keefe
wembley.instantiations at gmail.com
Fri Feb 20 16:56:43 UTC 2009
Julian -
OK, first the explanation of the compatibility issue:
VA Smalltalk implements both class-based and instance-based
exceptions. Internally we still mostly use instance-based and the
class-based exceptions are mapped one-to-one with existing (or new)
instance based exceptions).
However, there are still some subtle differences. One of these is the
effect of falling off the end of a handler block (a condition that is
not explicitly described in the ANSI spec). For class-based
exceptions, the code will resume if it was a resumable exception,
otherwise it will return; for instance-based exceptions it always does
a resume. To maintain compatibility with existing usage, I am very
reluctant to change this behavior for instance-based exceptions.
Dictionary>>#at: signals a non-resumeable instance-based exception
(another behavior I can't change). So, on VA Smalltalk, wrapping
Dictionary>>#at: in an exception handler with a handler block that
falls off the end tries to resume and halts with the debugger up (not
good!).
I obviously misunderstood the total ramifications of the exception
handler in this method. I think the best thing for me to do is leave
the change in the first line of code, and then put everything back
into an #on:do: with a handler block that does an explicit return.
John O'Keefe [|], Principal Smalltalk Architect, Instantiations Inc.
On Fri, Feb 20, 2009 at 11:14 AM, Julian Fitzell <jfitzell at gmail.com> wrote:
> John,
>
> I'm the error handler there must not have been there just to deal with
> #at: failing (though obviously it is handling that too) but also to
> handle the case where keyString is a collection (not a string) and is
> empty. I'm just surmising by looking at the code because it would not
> have made sense for someone to write it that way otherwise (clearly
> #at:ifAbsent: would be better for the #at: case).
>
> I don't quite understand the compatibility issue you mention. I
> certainly don't care if the code is rewritten without the #on:do: but
> it seems like your version is not at robust as the previous version
> was.
>
> Julian
>
>>Seaside-Core-jok.482.mcz
>>from Seaside 2.9 by John O'Keefe <john_okeefe at instantiations.com>
>>Since a WARequest understands at:ifAbsent:, use it.
>>This fixes a VA Smalltalk portability issue -- Dictionary>>#at:
>>signals an instance-based exception when the key cannot be found and that exception cannot be handled by an empty #on:do: handler block.
> _______________________________________________
> seaside-dev mailing list
> seaside-dev at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
>
More information about the seaside-dev
mailing list