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

Re: [Sc-devel] firstArg - why not valid for all objects?



So all that is needed is:

+ Object {
	firstArg { arg that; ^this }
}


 >On Feb 25, 2008, at 8:07 AM, Julian Rohrhuber wrote:

why would you want to use it anywy?


Well, like the example shows - I want the function to return the
value of a variable and also clear the variable.

Pfunc({ xyz }) -- doesn't clear

Pfunc({ xyz = nil; xyz }) -- doesn't return the value

Pfunc({ var temp = xyz; xyz = nil; temp }) -- obfuscation (imho) and
too much typing to use routinely in patterns

Pfunc({ xyz <! (xyz = nil) }) -- oh, very nice

ok, I see. Thanks for giving an example (still a bit obscure, but I
see the point!)


Except, if xyz is anything other than a number, this throws a math
op failed error. Math op failed? What math is being done?

well, this should be changed.

That's what I don't get. Why is this a math operator? What does it
have to do with math?

why should this not be math? it is no less math than addition. It is
like a kind of parentheses.
--





.
_______________________________________________
Sc-devel mailing list
Sc-devel@xxxxxxxxxxxxxxx
http://lists.create.ucsb.edu/mailman/listinfo/sc-devel


--





.