Re: Boolean operations
gatesphere <[email protected]> Thu, 01 Dec 2011 16:32:36 -0500
| Newsgroups | gmane.comp.lang.io |
|---|---|
| Message-ID | <[email protected]> |
Io> a := 4
==> 4
Io> if((a % 3 == 0) or (a % 5 == 0), writeln("true"), writeln("false"))
false
==> nil
Io> a = 3
==> 3
Io> if((a % 3 == 0) or (a % 5 == 0), writeln("true"), writeln("false"))
true
==> nil
Something like that.
-->Jake
On 12/1/2011 8:51 AM, andrey wrote:
>
> I am looking for boolean operations in Io. I need to write something
> like this:
>
> if (a == b) or (c == d) ....
>
> Now I have created such code:
>
> divided_by := method(a, b,
> a % b == 0
> )
>
> condition := method(a,
> if(divided_by(a, 3)) then (return true) else (
> if(divided_by(a, 5)) then (return true) else (return false)
> )
> )
>
> But I am looking for the better solution.
>
>