[Seaside] Unexecuted code

Avi Bryant avi.bryant at gmail.com
Sat Mar 18 19:32:07 UTC 2006

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.


More information about the Seaside mailing list