[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] if question



oh yeah, and: or: etc. are binary operators too...
thank you!
tom

On 5 Sep 2005, at 22:36, James Harkins wrote:

Method-Calls helpfile:

Operator Precedence

There is none. All binary operators have the same level of precedence and associate from left to right.
For example, the expression:

a * b + c * d

is equivalent to:

((a * b) + c) * d

and not:

(a * b) + (c * d)


Therefore it is usually better style to fully parenthesize your expressions.

hjh

On Sep 5, 2005, at 4:20 PM, Tom Tlalim wrote:

<x-tad-smaller>hello!
am i doing something wrong here?

a = 0;
if(a>0 and: a<2){"hi".postln}{"lo".postln}
</x-tad-smaller>
or here?
<x-tad-smaller>a = 2;
if( a<2 and: a>0 ){"hi".postln}{"lo".postln}

i get:

ERROR: Message '<' not understood.
RECEIVER:
false
ARGS:
Integer 2
CALL STACK:
DoesNotUnderstandError-reportError 066E7530
arg this = <instance of DoesNotUnderstandError>
Nil-handleError 066E7470
arg this = nil
arg error = <instance of DoesNotUnderstandError>
Object-throw 066E7410
arg this = <instance of DoesNotUnderstandError>
Object-doesNotUnderstand 066E73B0
arg this = false
arg selector = '<'
arg args = [*1]
< closed FunctionDef > (no arguments or variables)
Interpreter-interpretPrintCmdLine 066E72F0
arg this = <instance of Interpreter>
var res = nil
var func = <instance of Function>
Process-interpretPrintCmdLine 066E7290
arg this = <instance of Main>


ERROR: Message '>' not understood.
RECEIVER:
false
ARGS:
Integer 0
CALL STACK:
DoesNotUnderstandError-reportError 0648C1F0
arg this = <instance of DoesNotUnderstandError>
Nil-handleError 0648C130
arg this = nil
arg error = <instance of DoesNotUnderstandError>
Object-throw 0648C0D0
arg this = <instance of DoesNotUnderstandError>
Object-doesNotUnderstand 0648C070
arg this = false
arg selector = '>'
arg args = [*1]
< closed FunctionDef > (no arguments or variables)
Interpreter-interpretPrintCmdLine 0648BFB0
arg this = <instance of Interpreter>
var res = nil
var func = <instance of Function>
Process-interpretPrintCmdLine 0648BF50
arg this = <instance of Main>

grtz,
tom</x-tad-smaller>
_______________________________________________
sc-users mailing list
sc-users@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-users


: H. James Harkins
: jamshark70@xxxxxxxxxxxxxxxxx
: http://www.dewdrop-world.net
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal." -- Whitman

_______________________________________________
sc-users mailing list
sc-users@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-users

<x-tad-smaller>
..................
www.tomtlalim.tk
www.tangiercluj.tk
www.club-mtk.tk
..................</x-tad-smaller>