The Inbox: Kernel-ct.1251.mcz

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

The Inbox: Kernel-ct.1251.mcz

commits-2
A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-ct.1251.mcz

==================== Summary ====================

Name: Kernel-ct.1251
Author: ct
Time: 30 July 2019, 6:43:00.244625 pm
UUID: 86bd73cc-a91c-3644-82f4-3efa8777333d
Ancestors: Kernel-mt.1250

Convenience methods for exception handling

=============== Diff against Kernel-mt.1250 ===============

Item was added:
+ ----- Method: BlockClosure>>on:ensure: (in category 'exceptions') -----
+ on: exceptionOrExceptionSet ensure: aBlock
+
+ ^ self
+ on: exceptionOrExceptionSet
+ do: [:exception |
+ aBlock value.
+ exception pass]!

Item was added:
+ ----- Method: BlockClosure>>onInterruptEnsure: (in category 'exceptions') -----
+ onInterruptEnsure: aBlock
+ "Evaluate myself, evaluate aBlock if any error was thrown or the thread is going to be terminated"
+
+ | success result |
+ success := false.
+ [result := self value.
+ success := true]
+ ensure: [success ifFalse: aBlock].
+ ^ result!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Kernel-ct.1251.mcz

Tobias Pape

> On 30.07.2019, at 18:43, [hidden email] wrote:
>
> A new version of Kernel was added to project The Inbox:
> http://source.squeak.org/inbox/Kernel-ct.1251.mcz
>
> ==================== Summary ====================
>
> Name: Kernel-ct.1251
> Author: ct
> Time: 30 July 2019, 6:43:00.244625 pm
> UUID: 86bd73cc-a91c-3644-82f4-3efa8777333d
> Ancestors: Kernel-mt.1250
>
> Convenience methods for exception handling
>
> =============== Diff against Kernel-mt.1250 ===============
>
> Item was added:
> + ----- Method: BlockClosure>>on:ensure: (in category 'exceptions') -----
> + on: exceptionOrExceptionSet ensure: aBlock
> +
> + ^ self
> + on: exceptionOrExceptionSet
> + do: [:exception |
> + aBlock value.
> + exception pass]!
>
> Item was added:
> + ----- Method: BlockClosure>>onInterruptEnsure: (in category 'exceptions') -----
> + onInterruptEnsure: aBlock
> + "Evaluate myself, evaluate aBlock if any error was thrown or the thread is going to be terminated"
> +
> + | success result |
> + success := false.
> + [result := self value.
> + success := true]
> + ensure: [success ifFalse: aBlock].
> + ^ result!
>


I think #ifCurtailed is actually what the second method does...


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Kernel-ct.1251.mcz

Christoph Thiede
Tobias Pape wrote
> I think #ifCurtailed is actually what the second method does...

Yes, thanks, that was the method I was searching for :)



--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html

Carpe Squeak!