19 lines
338 B
Plaintext
19 lines
338 B
Plaintext
// intended use cases of ampersand:
|
|
|
|
var x = @[1, 2, 3, 4, 5];
|
|
|
|
x[0] = 0 & [2] = 0;
|
|
x[5] = 1 & [6] = 0 & [7] = 3 & [7] = 2;
|
|
|
|
//expect:@[ 0.0, 2.0, 0.0, 4.0, 5.0, 1.0, 0.0, 2.0 ]
|
|
print x;
|
|
|
|
// not very useful but still must be correct behavior tests:
|
|
|
|
// change of precedence where interjected
|
|
|
|
var y = 5 + 1 & * 3;
|
|
//expect:18.0
|
|
print y;
|
|
|