<niladicValuable> protocol

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

<niladicValuable> protocol

Ricardo Nogueira
In BlockClosure Class comment:

( ... )
*Note that Dolphin's <niladicValuable> protocol is not exactly the same as
the ANSI definition of <niladicValuable>. The ANSI definition includes the
selectors #whileTrue, #whileTrue:, #whileFalse, #whileFalse:, which we think
belong more properly in <niladicBlock>. We don't think that these selectors
should be in <niladicValuable>, since they don't make sense for most objects
that might otherwise claim to implement <niladicValuable>.
( ... )


But <niladicValuable> protocol is defining #whileTrue, whileTrue:,
#whileFalse and #whileFalse:.
Should we remove these selector from this protocol?

***

Besides, when writing blocks that need finalization and throw exceptions,
should the following be the calling format?

    aResource open.
    [[ aResource doSomething ] ensure: [aResource close]] on: [MyException]
do: [:e | self handle: e].


Thanks,

Ricardo
[hidden email]