// Test the forall syntax
class foo {
public const one = 1;
public const two = 2.0;
public const three = "three";
}
foo bar();
proc main()
{
var s = "Hello";
var d;
forall( s[i] ) {
"s[", i, "] = ", s[i], "\n";
}
d = <<< "red", 0xF00, "green", 0x0F0, "blue", 0x00F >>>;
d["red"] = nil;
forall( d[i] ) {
"d[", i, "] = ", d[i], "\n";
}
d = new Dict(4);
d[one] = bar.one;
d[two] = bar.two;
d[three] = bar.three;
d[parent] = bar.parent;
forall( bar.(i) ) {
if(bar.(i) != d[i]) {
"Barf! i = ", i, "; bar.i = ", bar.(i), "; d[i] = ", d[i], "\n";
}
}
}