FFI fix, new construct

Brian Rice water at tunes.org
Tue Mar 21 00:08:27 PST 2006


#ifCompletes:otherwise: was renamed to #ifCompletes:ifFails: now and  
are bootstrapped into the alpha images.

On Feb 10, 2006, at 11:37 AM, Brian Rice wrote:

> Hello,
>
> Thanks to some investigation via a contributor, I've figured out  
> the right fix for unsuccessful attempts to load an ExternalLibrary.  
> Also in that line of work, I noticed that unlessCompletes: and  
> ifCompletes: would be best implemented with a single construct, so  
> there is now:
>
> m@(Method traits) ifCompletes: successBlock otherwise: errorBlock
> "Executes the first method, and then executes either the  
> successBlock or the
> errorBlock depending on whether there is a non-local exit that  
> prevents the
> first from completing normally."
> [| exitedNormally result |
>   exitedNormally: False.
>   [result: m do. exitedNormally: True. result]
>     ensure: [exitedNormally ifTrue: [successBlock do] ifFalse:  
> [errorBlock do]]
> ].
>
> which I may rename as ifCompletes:ifFails: but that is not hard to  
> change at all. The important thing is that this nicely mirrors  
> ifTrue:ifFalse: and both ifCompletes: and unlessCompletes: are now  
> implemented in terms of it.

--
-Brian
http://tunes.org/~water/brice.vcf

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : /archives/slate/attachments/20060321/5e5e5666/PGP.pgp


More information about the Slate mailing list