Replacing GET-WORD! for Polymorphic "GET:ANY"

Replacing GET-WORD! for Polymorphic “GET:ANY”

So there's a lot of things in the mix, now... most importantly ^META is now the go-to for "give me that, as it is", without execution... and without decaying unstable antiforms.

This all ties into Lift the Universe, a concept from which there is no going back.

So what :FOO will do is completely open. I've suggested it might mean TRY when associated with PICK-ing:

>> block: [a b c]

>> block.4
** Error: there's nothing there, man

>> :block.4
== \~null~\  ; antiform

I think this idea has some merit.

So let me hammer out a couple of thoughts:

It's not really that great an idea to have values that are either an ACTION! or NULL. The problem there is that if you just try to call the action through a word reference...and it's null... then the null will silently just not run anything and be a no-op.

As a sample consequence of this principle, I don't think null tolerance of a slashed assignment is a good idea, nor does it need a special notation:

>> /foo: func [...] [...]
== ... ; an action

>> /foo: 10
** PANIC: Can't use /FOO assignment to assign an INTEGER!

>> /foo: null
** PANIC: (This should also panic)

If you really have something that may be an action, or may be null, then ^META-assign it via ^foo: and you won't get complaints.

Assigning TRASH! is less dangerous, because that is more like assigning a function that errors when you call it. But there is no operation for turning nulls into trash...

Unsetness is also less dangerous. And assigning VOID now "unsets" variables when done through non-^META assignment, which is easier to produce from null via an OPT.

It seems to me that allowing /FOO: to take void on the right hand side to unset variables is safe, and unlikely to happen on accident since it's hard to make voids on accident. This gives you a state you can test for (unset? $foo). So right hand side should be either a void or an action.

Propagating that gets tricky, e.g. if you want /bar: foo/ which is willing to propagate an unset state. foo/ on an unset variable seems obviously to need to be an error. GET can't get an unset variable (it's deliberately out-of-band of representable non-dual states, e.g. less-than-trash). You could say:

/bar: opt if set? $foo [foo/]

/bar: when set? $foo [foo/]  ; WHEN is the void-when-untaken IF

Pursuant to the "leading colon is TRY" syntax, maybe this could be:

/bar: opt :foo/

This would require a concept that accessing an unset variable isn't an immediate panic, but a definitional error... which offhand I'm not sure is that great an idea. But how different is an unset variable from trying to pick an item out of a block that's not there?

It could be that this modality of PICK or GET is a special mode, like pick:relax and unrelated to TRY, so it's not definitional-error related. That could solve the conflation.

Another point of concern: terminal slash as distorting...

When thinking about interplay with an action in a PACK! as the "unsurprising" bit. (If that's going to be viable, which currently I don't know, I just know it's the last thing I'm going to try.)

One of those things is whether foo/ is distorting, e.g. a variable holding a plain ACTION! should give back an action in a PACK! in that world. This would allow you to write:

>> bar: foo/
== \~[~&[frame! ...]~]~\  ; antiform (pack!)

If you didn't have that, you would have to write:

>> /bar: foo/
== \~&[frame! ...]~\  ; antiform (action!)

The thing is, if you wanted the ACTION! as-is, you could just say ^foo.

I've made it clear that the "PACK! acting as unsurprising bit" concept is speculative, but just wanted to mention that it comes into play here.