![](https://secure.gravatar.com/avatar/a503a2e41df1afeb1fe085445acb792e.jpg?s=120&d=mm&r=g)
Hello list, I found out that declaring arrays in this way: float a[], b[]; is buggy, as it seems the type for b[] is not taken as float. Maybe something else happens here (maybe passing by ref), I haven't check thoroughly (don't know if it happens with other types as well). See the following code: // ******************************* // this works: // ******************************* float freq, amp; fun void Do( float freq, float amp) { <<<"do sthg">>>; } Do(freq,amp); // ******************************* // also works: arrays declared in separate lines // ******************************* float freq1[1]; float amp1[1]; fun void Do( float freq[], float amp[]) { <<<"do sthg">>>; } Do(freq1,amp1); // ******************************* // throws error :argument type(s) do not match // arrays declared in the same line // ******************************* float freq2[1], amp2[1]; Do(freq2,amp2);
![](https://secure.gravatar.com/avatar/33723e8059722928b8dfe2921435f9de.jpg?s=120&d=mm&r=g)
On Tue, Nov 11, 2008 at 6:07 AM, eduard aylon
I found out that declaring arrays in this way:
float a[], b[];
is buggy, as it seems the type for b[] is not taken as float. Maybe something else happens here (maybe passing by ref), I haven't check thoroughly (don't know if it happens with other types as well).
There are a few related bugs listed on the wiki. A workaround is to declare them separately. http://wiki.cs.princeton.edu/index.php/ChucK/Bugs -- Tom Lieber http://AllTom.com/
![](https://secure.gravatar.com/avatar/a503a2e41df1afeb1fe085445acb792e.jpg?s=120&d=mm&r=g)
Hi tom, thanks for your reply. As I reported this bug, it came back to my head that it may be me who reported this bug some time ago... if I'm not mistaken. However, somehow, I felt this was already solved. IMHO this should be highest priority, as it is common to declare a few variables in one row, and find out that it is forbidden in chuck is tough. thanks for pointing me to the wiki, eduard On Nov 11, 2008, at 3:33 PM, Tom Lieber wrote:
On Tue, Nov 11, 2008 at 6:07 AM, eduard aylon
wrote: I found out that declaring arrays in this way:
float a[], b[];
is buggy, as it seems the type for b[] is not taken as float. Maybe something else happens here (maybe passing by ref), I haven't check thoroughly (don't know if it happens with other types as well).
There are a few related bugs listed on the wiki. A workaround is to declare them separately.
http://wiki.cs.princeton.edu/index.php/ChucK/Bugs
-- Tom Lieber http://AllTom.com/ _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
participants (2)
-
eduard aylon
-
Tom Lieber