[chuck-users] comma is and? undocumented feature
jakkanen at mac.com
Sat Jun 28 15:14:34 EDT 2008
This seems to be similar to the comma operator in C, which lets you
use multiple comma-separated sub-expressions in a context where only a
single expression is allowed. An expression using the comma operator
evaluates to the value of the last sub-expression. Note that the comma
operator is very different from how && works.
On Jun 28, 2008, at 10:57 AM, Kassen wrote:
> Dear list,
> Consider the following;
> if( 1 , 0)
> if( 1 , 1)
> I think this isn't according to the language specs but it runs just
> fine. It seems that the comma equates to "&&"? it's not problematic
> in the slightest but it's not according to the specs either, I
> think, and a bit confusing.
> What's up here?
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
More information about the chuck-users