JUST the APOSTROPHE (') SIGIL!

This ties together quite nicely. cc: @bradrn


So I'd been fretting over whether @ would bind the thing you passed it or not. It had to bind things for the system to work, so I went with that... even though it may not be what you want in all cases:

>> abc: 10

>> word: @ abc
== abc

>> get word
== 10

@foo is a THE-WORD! and so @ makes sense as a synonym for an operator called THE.

>> the abc
== abc ; bound

But what if you don't want a binding? THE/UNBOUND? Is there no symbol?

A Part In The Box Becomes Available: APOSTROPHE (')

For a very long time, apostrophe was considered the quoted form of VOID (or NULL, before void existed). So it evaluated to void, and voids were invisible in the console:

>> if false [print "conditional returns void"]

>> meta if false [print "conditional returns void"]
'

>> quote void
== '

>> append [a b c] '
== [a b c]

"Isn't that cool", I thought. "Void is the absence of anything, and so when you quote it you get just a lone apostrophe. And when the lone apostrophe boils away after removing the quote in evaluation, you have nothingness!!! It's perfect for displaying nothing as a result!"

Slow clap. :clap:

It was a cute idea in the pre-isotopic era. But once we had quasiforms and antiforms, making void the antiform of the word void has many more merits.

So lone apostrophe went back into the "unused" bin, and I wondered what to do with it. What type would it be? Couldn't be a WORD!

But... SIGIL! Were Invented Simultaneously To ~void~

They happened in basically the same week. I'm not sure why it didn't occur to me to make ' a SIGIL!

Why not?

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

Now we have our non-binding literal operator.

>> abc: 10

>> word: ' abc

>> get word
** Script Error: abc word is not bound to a context

And I think a good name for it would be... JUST:

>> just abc
== abc  ; not bound
  • It's a good part of speech (LITERAL seems like a variable name)

  • It's short (LITERALLY would be obnoxious)

  • I think that JUST has a good shade of meaning of "just give me the array element, I don't want the extras...no pickles, no lettuce, and no binding"

Seems Perfect To Me

This goes along with the idea of when you declare your function arguments as being literal, if you say 'foo for the argument you will get it with no added binding, and if you say @foo it will bind in the context of the callsite.

Anyway, they're "literal arguments"... not "quoted arguments"... because no quoting level is added. Except perhaps an imaginary quoting level added in your head at the callsite which the evaluator strips off, but that doesn't happen. (In fact it can't happen for @, because for anything but a plain WORD!/BLOCK!/TUPLE!/etc. there's no way to add an @ onto something like an INTEGER! or the like.)

2 Likes

So there's a bit of a consistency question here with quasiforms, and why you would not say:

>> sigil of first [~void~]
== ~

We do not want it to be a SIGIL! because sigils are not quasiforms, and hence can't evaluate to antiforms, and it would break everything. :frowning:

But I think this can be resolved kind of how SET-WORD! is resolved. The sigil could be two tildes.

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

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

>> sigil of first [~void~]
== ~~

Makes more sense than the double colon sigil for SET-WORD! there. Because after all, there are two tildes on the quasiform. Well, except for "trash" (a.k.a. META-NOTHING, a.k.a. QUASI-BLANK):

>> sigil of first [~]
== ~~

Don't think I'll lose sleep over that.

Anyway, that seems like a good rationale for SIGIL_QUASI. But what should it do in the evaluator?

>> ~~ [a b c]
== ~[a b c]~

I can't think of when I'd ever use that instead of just '~[a b c]~

>> block: [a b c]

>> ~~ block
== ~[a b c]~

That's ever so slightly more likely to be useful, but I don't mind typing quasi block

Offhand, I don't know. It would have to be something related to quasiforms or antiforms. Or maybe just alarming things in general... some kind of TBD, that just errors?

>> not-implemented: foo: func [x] [~~]
** Error: ~~ encountered

Anyway, I'll be on the lookout for some evaluator behavior that makes life easier.

My apologies, it’s been a while since I’ve thought about this… could you remind me again what @foo means?

@foo just evaluates to itself.

>> @foo
== @foo  ; should be bound

I realize it should evaluate to itself bound. Because if you wanted it unbound, you could just do:

>> '@foo
== @foo  ; unbound

The $foo gives you the thing bound, but undecorated.

>> $foo
== foo  ; bound

Then the $ operator binds what you pass it but evaluates.

>> $ first [foo bar]
== foo ; bound
1 Like

Interestingly, making apostrophe a SIGIL! winds up being different from the other sigils...

They can't compose, so you can't make an @$ or a ::: or a ^^, or anything like that.

But the ' is different, since you can quote it!

So '' has an obvious evaluator behavior, as does ''', '''', etc.

>> ''
== '

>> '''
== ''

But you don't have to use it that way in your dialects. You now have new parts in the box: an arbitrary number of apostrophes in a row. (Ok, quote levels can only count up to 127 at present... so including the sigil for the quote you can have up to 128.)

You could use it for Unary Number Representation!

But do note: the QUOTES OF won't count the sigil.

>> quotes of first [''']
== 2

So:

unary-to-int: func [unary] [
    assert [(just ') = heart of unary]
    return 1 + quotes of unary
]

It's of course necessary for quoted sigils to exist, for the whole meta-representability thing to work.

I just find it interesting that we have this dialecting piece again. (When apostrophe was quoted void, we also had it.) I don't have any immediate ideas on dialect uses, but I bet I'll think of something. :brain:

So one thing that may not be completely semiotically idiotic would be UNMETA.

>> x: ^ null
== ~null~

>> ~~ x
== ~null~  ; anti

Of course it doesn't always produce an antiform or quasiform.

>> ~~ first ['''abc]
== ''abc

But it still might be argued to suggest "go downward", given that quasi and antiforms are at the bottom of the isotopic totem pole.

Really I want arrows for this. :pouting_cat:

>> x: ↑ null
== ~null~

>> ↓ x
== ~null~  ; anti