[chuck-users] crashing VM on (<string> != null) test?

Hans Aberg haberg at math.su.se
Wed Jun 24 16:21:56 EDT 2009


On 24 Jun 2009, at 21:41, Andrew Turley wrote:

> Hans, the bus error that you're seeing is a result of the fact that
> you are trying to print out a null value. Your code isn't even getting
> to the conditional.

Yes, I changed it to:
   null @=> string g;  // Or: =>
   <<< "g = ", g, "." >>>;
Then it does not get to the ".".

If 'chuck' wants to make pointers transparent, then this is a flaw (if  
not a bug).

> If I had to guess (and I should really just look at the code), the
> "==" and "!=" operators when applied to strings in ChucK end up doing
> a string comparison, NOT a pointer comparison or reference comparison.

This is another problem with the ChucK model of attempting to largely  
hide away pointers. Then perhaps 'chuck' checks the pointers for  
reference types without equality, but for the data when available.  
That is indeed confusing.

   Hans




More information about the chuck-users mailing list