Weird WORD!s - Allow, But Escape Them?

So I'm having cold-feet on the idea that sigils should be able to be WORD!, when you can't create decorated forms of them.

In the "freedom to" and "freedom from" dynamic, it's nice to have freedom from a WORD! that can't be turned into a SET-WORD!.

But there are big convolutions that come into play if colons are words, with people saying something like:

 make object! [
    {:}: does [print "colon as key"]
 ]

...if they expect that to make a key in the object named ":". Having a key that can't be made into a SET-WORD! turns everything on its head if you expect things to handle it.

>> setify ':
== {:}:  ; but not an ANY-WORD!... welcome to consequence city, population: me

It really wrecks the implementation to say that you search not only for SET-WORD!, but also SET-FENCE! (or whatever). It ripples too far.

Same for @ and $ and & and ^.

So here we see another angle of that freedom-to/freedom-from. If you're free from the idea that : is a word, then it can be a COLON!. ^ can be a CARET!. If we have a datatype for COLON!, we can give that colon behavior in the evaluator. Users can give it behavior in dialects.

SET-BLOCK! doesn't have to be concerned about not being able to assign to a variable named "^" because there aren't variables named "^".

When we were at a 64-datatype limit, ^ and @ had to be words, there wasn't space for them to be datatypes. But now this is possible, and I think it's the direction to go.

They could either be their own datatype (as members of the category ANY-SIGIL?), or just use one type and be SIGIL! Probably one type is better.

I do like the idea of having :: as a dialecting part. But as @bradrn said (somewhere), if you're willing to use the justification of "would be nice to have in a dialect" then that could be used to justify practically anything.

Maybe the types are something like COLONS! and CARETS!, and have lengths?

>> type off first [:::]
== &[colons]

>> length of first [:::]
== 3

Then colon? and &colon? could be the type constraint for a single colon. That's kind of batty (and disrupts the idea that these are always sigils).

OR MAYBE... we could argue that :: is a unique datatype that's the answer to SIGIL OF for a SET-WORD!

>> sigil of first [:a]
== :

>> sigil of first [a:]
== ::

>> sigil of first [a]  ; void or null, or maybe BLANK! is an ANY-SIGIL?
== ~null~  ; anti

This gives completeness (one sigil per sigilized form), and adds a kind of nice extra part that I think might be nice in dialecting. I guess that :: would be named COLONS!, or maybe COLON-2! would be easier to see as distinct from COLON! (or COLON-COLON!... kind of a long type name, but whatever).

Anyway, this would remove one axis of second-class citizens from the world, and I would be much relieved about the cases of needing to render out MAKE OBJECT! with sigils as keys.

1 Like