[Newbies] Re: Re: Re: error trap
Damien Cassou
damien.cassou at laposte.net
Mon Aug 14 08:17:40 UTC 2006
Klaus D. Witzel wrote:
> On Sun, 13 Aug 2006 18:31:23 +0200, Damien Cassou wrote:
>> Klaus wrote:
> Perhaps I should add rules of thumb for when to *author* a block of code:
>
> #1 - for a non local return like [^ nil]
> #2 - for deferring a computation like [base raisedTo: bigInteger]
> #3 - for parameterized "smart" logic like [:x :y | "do something with
> self, x and y"]
>
> Anybody anything for #4 ?
>
> Unfortunately there are, enforced by people who wrote the compiler,
> other rules (not many of them are for the thumb). For an example try a
> printIt on
>
> ^ true ifTrue: #a ifFalse: [false ifTrue: #b ifFalse: #c]
>
> Again, a "natural" confusion between an object's value and a block's value.
"
<- argument of ifTrue: must be a block or variable ->
"
In VW, there is no Object>>value method. But #value is implemented in
Boolean and UndefinedObject. Is this Smalltalk-standard to have #value
on Object ?
More information about the Beginners
mailing list