[chuck-users] assignment of integers?

Kassen signal.automatique at gmail.com
Tue Feb 19 21:43:58 EST 2008


Fellow ChucKists,

consider;
----------------------------
int foo @=> int bar;

//yields semi-random high number
<<<bar>>>;
-----------------------

and;

-----------------------
1 => int foo @=> int bar;

//yields "1"
<<<bar>>>;

2 => foo;

//yields "1"
<<<bar>>>;
------------------------------

Integers seem to be in some sort of state of doubt between being assignable
and not being assignable (maybe also in doubt about being a object? the poor
things!).

This becomes somewhat important if bar is a member of a class that -for it's
member functions- would benefit from knowing what happens around it. I can
still turn both foo and bar into length 1 arrays or keep passing foo as a
argument to such functions but that's not as pretty.

Yours,
Kas.


PS for those who hadn't seen this yet; length 1 arrays to trick integers
into becoming full objects was cooked up by Frostburn here;
http://electro-music.com/forum/viewtopic.php?t=23628

Maybe inspired by this strategy to turn functions into objects (in a
roundabout way);
http://electro-music.com/forum/viewtopic.php?t=23546

Tricky but useful.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20080220/1dede028/attachment.htm 


More information about the chuck-users mailing list