shards icon indicating copy to clipboard operation
shards copied to clipboard

Change basic shard operation on tables

Open guusw opened this issue 2 years ago • 2 comments

Shards like Set, Update, Push, etc. that take a table key are able to do complicated operations on elements inside sequences or tables.

Some downsides of having this on these shards:

  • More complex implementation
  • More variables in documentation
  • Harder to understand what they do from a user POV

It is fast though and removing this behavior would require unpacking a bunch of structures, updating values and packing them again.

Ideally we could have some way to reference values without introducing pointers to the language, e.g.:

{:Name "a" :Seq [0 1 2] :Child {:Name "b"}} >= .table
2 (Push (ref .table "Seq"))
"New Name" > (ref .table "child" "name")
3 (Push (ref .table "Child" "Seq"))

where (ref) is some kind of mechanism to refer to vars inside other vars

guusw avatar Aug 03 '22 09:08 guusw