problem in porting from smalltalk
stéphane ducasse
ducasse at iam.unibe.ch
Sun Feb 19 12:33:57 UTC 2006
In smalltalk there are two forms for conjunction (and) : the lazy and
"normal" one
and: evaluates only the second argument is the first one is true
so you have to pass a block
(1 > 2) and: [3 error]
(1 <2) and: [3 error]
compare
with
(1>2) & (3 error)
Stef
On 19 févr. 06, at 12:20, nelson - wrote:
> hi,
> i'm porting some code from smalltalk and i receive a runtime
> error of this type
>
> argument of or: must be a block or variable
>
>
> (or: is the method i'm implementing)
>
> I pass to it a variable i suppose ( the number 0.2)
>
> this is the code:
>
> a _ FuzzyMagnitude new degree:0.7.
> b _ FuzzyMagnitude new degree:0.20.
> a and: b.
> a and: <- argument of and: must be a block or variable ->0.2.
>
> (FuzzyMagnitude is an object that i have defined)
> advice,
> nelson
> thanks for any
>
More information about the Squeak-dev
mailing list
|