I have another use of TRIPWIRE that I don't know if it's good or bad, but...
I've always wanted FAIL to stand out more. When it first was invented (and Ren-C was case-insensitive), I would type FAIL in uppercase to get it:
foo: func [x [integer! text!]] [
switch/type x [
integer! [print "It's an integer"]
text! [print "It's a text"]
FAIL "unreachable"
]
]
Then I came up with the idea to use QUASI-WORD!s (that would evaluate to antiform words):
foo: func [x [integer! text!]] [
switch/type x [
integer! [print "It's an integer"]
text! [print "It's a text"]
fail ~unreachable~
]
]
I thought it looked cool and drew attention more than fail "unreachable"
, while being the same number of characters. It acted the same, but cost a bit less due to the interning of the word.
But now, "keywords" are restricted to a finite system set. So by necessity, this has changed to use quasiform/antiform TAG!s:
foo: func [x [integer! text!]] [
switch/type x [
integer! [print "It's an integer"]
text! [print "It's a text"]
fail ~<unreachable>~
]
]
Now it's two more characters, doesn't cost any less than a string, and at the moment still acts the same as a string. Is it still a useful thing? Compared with:
foo: func [x [integer! text!]] [
switch/type x [
integer! [print "It's an integer"]
text! [print "It's a text"]
fail "unreachable"
]
]
I truly like that you can "see" the error better when it's ~<unreachable>~
...and go "oh, there's an error there". I imagine this being particularly cool with syntax highlighting.
To make that visibility advantage systemic, would it be reasonable to say that all FAILs take antiform tags and not strings? Then if you have a message in a text string you would have to say fail [msg]
instead of just fail msg
. I don't think that's terribly oppressive.
I don't completely like the idea of it being a choice/synonym, because then people will just stylize their code differently and inconsistently...the same person even making different choices in the same file. But it could just be a synonym and let you pick what you like for the situation, and maybe that's good.
Or maybe it's a dumb feature. I don't know.