The general pitch of unstable block antiforms is that they decay to their first element in assignments to single words:
>> x: pack [1 2]
== \~('1 '2)~\ ; antiform (pack!)
>> x
== 1
SET-BLOCK! is one of the things that is able to do special handling to pick apart the pack:
>> [x y]: pack [1 2]
== \~('1 '2)~\ ; antiform (pack!)
>> x
== 1
>> y
== 2
But you can create your own operators that work with packs... they're just antiform blocks, after all. If you take an argument as ^META and typecheck for packs you can do whatever you like. You could re-implement the functionality of SET-BLOCK! yourself if you felt like it, designing whatever you want:
>> my-10times-assigner [x y] pack [1 2]
== \~('1 '2)~\ ; antiform (pack!)
>> x
== 10
>> y
== 20
But Should Plain Assignments Ever Process Packs?
e.g. should this hypothetical PACK-SUMMER! be possible, which assigns the sum of pack elements?
>> type of ps
== ~{pack-summer!}~
>> ps.x: pack [10 20]
== \~('10 '20)~\ ; antiform (pack!)
>> ps.x
== 30 ; e.g. the assignment received 10 + 20
You can imagine other ideas, such as reacting to raised errors somehow, vs. having an enforced pattern of skipping the assignment and propagating the raise. ![]()
Freedom To vs. Freedom From
This doesn't seem like a wise axis of extensibility to me.
The possible benefits appear outweighed by the loss of certainty about how things will act.
It also means doing minor transformations would wreck things.
>> temp: pack [10 20]
== 10
>> ps.x: temp
== 10
But while that may seem damning, it's the case for any time a function takes an unstable antiform... you can't factor the expression and expect it to work the same. To truly preserve things, you have to do lift and unlift.
>> temp: lift pack [10 20]
== ~('10 '20)~
>> ps.x: unlift temp
== \~('10 '20)~\ ; antiform (pack!)
>> ps.x
== 30
But still... I just don't think I like the idea of having what looks like an assignment be able to subvert the expectations that you're taking decayed information.
The one exception I am making is for the empty ~()~ antiform, which indicates a desire to remove the key itself. So the assignment (POKE) protocol gets 0 or 1 values. I think that one exception is enough.