Using Apostrophes in Names: What Happens When You Quote?

I've buried the hatchet, and stopped questioning apostrophe for quotes. I accept it for the purpose it was originally intended.

The acceptance is based on three premises.

First, accept apostrophe's slight appearance as a benefit

In @rgchris's words:

"I am a member of the apostrophe fan club--I think its inherent discretion is part of what makes Rebol a more elegant language."

When you look at a lot of average-case code, the near-equivalence of 'foo and foo becomes a feature instead of a bug:

parse [apple banana banana] ['apple some 'banana]
parse [apple banana banana] [@apple some @banana]

Secondly, use THE for literal forms in the source

 if word = the isn't [...]

It may be that even the quoted values could find an alternate rendering...like how "^"" will be picked to render as {"} by molding. So perhaps 'isn't or ''double-quoted-double-primed'' could have some options too.

UPDATE 2022: Indeed, this is the case with weird WORD!s... you use vertical bars!

>> '|isn't|
== isn't

>> ''|double-quoted-double-primed''|
== '|double-quoted-double-primed''|

Thirdly, stop using WORD! for enumerations.

If you used something weightier like an ISSUE!, the fact that apostrophe is so skinny wouldn't come up.

 switch mode [
     'read [print "too skinny!"]
     #read [print "better..."]
     <read> [print "also better..."]
     %read [print "fine too."]
     @read [print "coming someday..."]
 ]

If you only use words when you need evaluation, you'll need escaping less. And you'll be doing yourself a favor in COMPOSE situations where you won't constantly have to be worrying about the word getting its quote knocked off and then evaluating in some other situation.


The full post announcing the "finalized" (cough) generic quoting mechanism is here:

1 Like