aggregate behavior question

Fluxxdog

Active member
Code:
> ash boolean[monster]jumper=$monsters[fluffy bunny,rolling stone]; jumper[$monster[large kobold]]=true;

Cannot modify constant value ()
Returned: void

> ash boolean[monster]jumper; jumper=$monsters[fluffy bunny,rolling stone]; jumper[$monster[large kobold]]=true;

Cannot modify constant value ()
Returned: void

> ash boolean[monster]jumper; jumper+=$monsters[fluffy bunny,rolling stone]; jumper[$monster[large kobold]]=true;

Cannot modify constant value ()
Returned: void
Okay, the '+=' was a bit of long shot, but is this expected behavior or is the jumper aggregate being established as an array like this?
 
That's not a good way to define a map. Don't initialize it as a plural typed variable. If you do that you establish it as a constant and cannot alter the values. I recommend doing it like this:

Code:
ash boolean[monster]jumper; foreach m in $monsters[fluffy bunny,rolling stone] jumper[m] = false; jumper[$monster[large kobold]]=true;
 
Yeah, that's what I've been using, but it just seemed the long way around, especially since the boolean value isn't important, just the list of monsters. Thanks!
 
Back
Top