[Seaside] Unexecuted code
Zulq Alam
zulq at orange.net
Sun Mar 19 01:49:08 UTC 2006
Thanks.
Avi Bryant wrote:
>
> On Mar 18, 2006, at 8:42 AM, Zulq Alam wrote:
>
>> Perhaps it's my lack of experience with Smalltalk but I'm struggling
>> to understand what happens to code which is not executed after an
>> answer.
>>
>> go
>> parameter isNil:
>> [self inform: 'You must specify a parameter.'.
>> self answer].
>> someObject someActionWith: parameter.
>> self answer.
>>
>> Let's assume that "parameter" is set by some form input which in this
>> case is nil. I would expect the last two statements to execute when
>> "self answer" returns which, as I understand, never will.
>>
>> So, what happens to the last two statements? They must have been on
>> the stack (or whatever Squeak/Smalltalk uses!) and I would assume
>> that "self answer" pushes on to the stack. So doesn't the stack grow
>> indefinitely?
>
> No, #answer blows away the current stack - think of it like a longjmp.
>
> Cheers,
> Avi
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
>
More information about the Seaside
mailing list