i'm learning ada , trying simple loop working (using new iterators syntax ada 2012). cannot see what's wrong...
with ada.text_io; use ada.text_io; procedure arrays type v array (0 .. 1, 0 .. 2) of natural; : v := ((10, 20, 30), (400, 500, 600)); begin e of loop -- compiler error here! e := e + 1; end loop; end arrays; my compile command "$ gnatmake -gnaty -gnaty2 -gnat12 arrays" (for pedantic style enforcement , enable 2012 features). compiler error is
arrays.adb:8:14: few subscripts in array reference (i'm using gnatmake 4.6 on raspi).
this code pieced john barnes' book "programming in ada 2012" p.120-121. i've trimmed down code as can, that's why doesn't much. far can see, it's effetively identical examples in book.
what doing wrong?
Comments
Post a Comment