Return value from an ensure block ...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Return value from an ensure block ...

Dennis smith-4
This was possible in 2.x (and GS32 6.x), but does not seem to be in 3.x.

Given a block like this
     [
             ...
             xxx ifTrue: [^123].
             456
     ] ensure: [
            ... obtain the 123 ...
     ]

In 2.x, you could dig it out on the stack, but in 3.x it looks like only
the VM might know.
Anyone wanted to do this??

I know it would be simple enough to say
         return := 123.
         ^return

the problem occurs when you have 1000+ such blocks scattered around.



--
Dennis Smith                                  +1 416.798.7948
Cherniak Software Development Corporation   Fax: +1 416.798.0948
509-2001 Sheppard Avenue East        [hidden email]
Toronto, ON M2J 4Z8              sip:[hidden email]
Canada                     http://www.CherniakSoftware.com
Entrance off Yorkland Blvd south of Sheppard Ave east of the DVP

--
GemStone-Smalltalk mailing list
Unsubscribe: send e-mail with the word "unsubscribe" in body (without quotes) to:
  [hidden email]
Archive: http://forum.world.st/Gemstone-Customers-f1461796.html