1

If I have

dict:`a`b!(1 2 3;4 5 6 7)

Can I append an element to dict`b without redeclaring the whole dict?

ie what's the best way to get to

dict:`a`b!(1 2 3;4 5 6 7 8)
Donald_W
  • 1,773
  • 21
  • 35
nightTrevors
  • 639
  • 4
  • 11
  • 24

1 Answers1

2

You can do

dict[`b],:8

but it will automatically overwrite the dictionary.

A more robust way would be

@[dict;`b;,;8]

or

 @[`dict;`b;,;8]

where the latter automatically overwrites the dictionary, while the former creates a modified copy of the dictionary (in case you don't want it to overwrite the original yet)

terrylynch
  • 11,844
  • 13
  • 21