Why Does QUOTE Exist If LIFT is a Superset?

Why do quote and unquote exist when lift and unlift can do the same thing, while handling more cases?

2 Likes

Sanity check.

Antiforms are weird, and creating them (or tolerating them) when you didn't mean to is good to avoid.

Unstable antiforms are particularly weird...for instance antiform GROUP! cannot be stored in variables. In normal assignments it decays to its first element, while multi-assignments and other particular constructs interpret it as multiple values:

>> quasiform: first [~('1020 ~null~)~]
== ~('1020 ~null~)~

>> x: unlift quasiform
== 1020

>> [x y]: unlift quasiform
== 1020

>> y
== \~null~\  ; antiform

This is how multi-return functions are implemented.

What's nice about UNQUOTE vs UNLIFT is that if you are really not suspecting you're dealing with a quasiform that should become an antiform, you can avoid the potential confusion caused.

And QUOTE has a similar convenience of not tolerating an antiform when you didn't think there'd be one. It actually decays its input, if it's a PACK!

>> x: multi-returner ...
== 10

>> x: lift multi-returner ...
== ~(10 20)~

>> x: quote multi-returner ...
== '10

QUASI and UNQUASI Also Exist

A narrower operator of QUASI and UNQUASI exists to make it clear when you're only adding or removing a quasi state. So you can QUASI only plain non-quoted things, and UNQUASI only non-quoted quasiforms. Then NOQUASI will pass through all values except drop the quasi from quasiforms.

Just helps readers get their bearings on what's going on if that's all that's happening.

1 Like

OK, I think this made it ‘click’ for me… I didn’t realise quote and lift would yield these different results in such a situation.

1 Like

3 posts were split to a new topic: What To Name "LIFT:LITE" ?