Actually needs two little patches:
- One when you have just defined an aggregate
- One when you have a multiple layer map and are parsing an aggregate literal.
With revision 17658:
yields
I like it.
- One when you have just defined an aggregate
- One when you have a multiple layer map and are parsing an aggregate literal.
With revision 17658:
Code:
record rec1 { int a; string b; };
rec1 [int,int] rmap {4: {4: new rec1( 10, "abc" ) }, 10: {40: new rec1( 100, "xyz" ) } };
foreach key1, key2, val in rmap {
print( "[ " + key1 + ", " + key2 + " ] -> ( " + val.a + ", " + val.b + " )" );
}
Code:
[color=green]> test-map2[/color]
[ 4, 4 ] -> ( 10, abc )
[ 10, 40 ] -> ( 100, xyz )