Re: [Boa Users] Maps of maps

20 views
Skip to first unread message

Robert E Dyer

unread,
Dec 13, 2016, 1:28:38 PM12/13/16
to boa-...@googlegroups.com
Hi Andrew,

The support for nested maps/stacks/etc is brand new.  I really hadn’t properly written out a full set of tests for it.  It seems you found a bug.

I can reproduce the bug and I actually know what the problem is.

For now, you can work around the bug as follows.  Instead of writing temp[“string”][0] = x; you can write:

m := temp[“string”];
m[0] = x;

This should work until I get a proper fix in!

- Robert

On Dec 13, 2016, at 4:32 AM, Andrew Lin <al...@gmail.com> wrote:

Hi, I've been trying to use a 2D Map, such as a map[string] of map[int] of Expression. Only the string index is meaningful. The int is just an index, so I store in order from 0 to n. I'm only using it as basically an expanding array.

However, I get various problems while using this.

If I try to assign something to this 2D map, such as temp["string"][0] = x;, I get an error during compilation (I don't get a location for the error or anything else though, it just says 

Compilation 
Status Error



If I try to access something from the 2D map, such as if(def(temp["string"][0])), I get a similar error: during execution 
Execution 
Status Error



Am I doing something wrong, or are these bugs related to maps on maps? Or are there any suggested alternatives to implement something like this?

Thanks in advance! 

Robert E Dyer

unread,
Dec 13, 2016, 1:30:55 PM12/13/16
to boa-...@googlegroups.com
For reference, I filed this as a new issue: https://github.com/boalang/compiler/issues/74

You can track progress there.

- Robert

Robert Dyer

unread,
Dec 20, 2016, 12:40:39 AM12/20/16
to Boa Language and Infrastructure User Forum
This bug is now fixed.  It should be fixed in any future datasets, and I back-ported it to the GitHub Sep 2015 datasets.

- Robert
Reply all
Reply to author
Forward
0 new messages