[chuck-users] How to compare strings?
gewang at CS.Princeton.EDU
Fri Sep 16 01:25:04 EDT 2005
> I figured out that 'associative arrays' can be used for string
> comparison, ie. by associating unique numbers with the strings to be
> checked. For example
> int x;
> 1 => x["abc"];
> 2 => x["def"];
> Now a string variable s can be checked for equality by writing
> Note that this works without explicit use of the numbers.
We hereby present you with the award for "best work-around of the month
necessitated by a bug in ChucK".
This hack is simply fantastic (especially since strings are quite
broken in the language). Thanks for pointing out the string comparison
bug (now on the 184.108.40.206 queue) and this rather unforeseen use of
More information about the chuck-users