Re: Numerical Collections

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

Re: Numerical Collections

Nicolas Cellier-3
I can add only one objection to the compute: lazy evaluation.

If one does not use clean blocks, then block execution may fail if context is
no more active...

Here is a perfectly silly example, it does not mean a thing, i did not try it,
but i think it should fail:

buggy
    | offset |
    offset := 0@0.
    points compute: [:e |
        offset := offset + 1.
        e translatedBy: offset]

buggyEvaluation
    ^self buggy sum

Of course, clean programmers should make clean blocks, but who knows how a
general purpose library will be used...