[ExM Users] 2D arrays

Tim Armstrong tim.g.armstrong at gmail.com
Thu Jun 26 15:04:50 CDT 2014


Yes 2D arrays are supported with the same declaration syntax as Swift/K.
You're trying to declare a 2D array with key types i and j in each loop
iteration.  The compiler is correctly pointing out that i isn't a type.
You need to declare it outside of the loops then assign it inside the loops.

- Tim


On Thu, Jun 26, 2014 at 2:44 PM, Ketan Maheshwari <ketan at mcs.anl.gov> wrote:

> Are 2D arrays of this style supported in T:
>
> main {
> foreach i in [0:31]{
>         /*string commands[] = ["head","tail","wc","stat"];*/
>         foreach j in [0:24]{
>                 string pyline=sprintf("import cPickle as
> pickle\n\nrepr(pickle.dumps({'foo1':%s,'foo2':%s}))", i, j);
>                 string pickle[i][j] = python(pyline);
>         }
> }
> }
>
> stc gives following error:
>
> stc error:
> multi-map-reduce.swift:15:3: The following type was not defined in the
> current context: j
>
> _______________________________________________
> ExM-user mailing list
> ExM-user at lists.mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/exm-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/exm-user/attachments/20140626/ec874c94/attachment.html>


More information about the ExM-user mailing list