The stated goal of Ren-C was experimentation, to try things that may-or-may-not be good ideas... push them around and get experience with them, and possibly revert ideas that turn out to be bad (or create new ideas).
There a long and drawn-out description on the Trello card for getting rid of the name LENGTH?. This is one of the operations for which people were most unhappy with calling it LENGTH-OF. So even though LENGTH is very "nouny" (and the name of several refinement parameters storing lengths, e.g. /PART LENGTH), it was defaulted to a synonym of LENGTH-OF.
But...aesthetics matter. For instance: I am turned off by the look of foo == bar and its deceptive supposed complement foo !== bar (vs. foo != bar which is actually the complement of foo = bar...good luck with that, C programmers). That gives rise to musings on = and IS.
So it should not be surprising that I have suffered a fair amount of cognitive dissonance on things like LENGTH?/LENGTH-OF/LENGTH. We may be used to HEAD and TAIL but not LENGTH, kind of how we're used to FOREACH but not MAPEACH (which doesn't make FORECH good, nor HEAD or TAIL). Still, correcting it pains me, to look at what might be called a kind of -OF pollution, which is throwing extra words in places they do not belong.
I was writing some example code and had this:
foo: func [n /accum a] [
case [
not accum [a: 0 | recurse: true]
n = 0 [return a]
]
frame: context-of 'n
n: n - 1
a: a + 2
redo frame
]
And while I found myself liking the elegance of it on the whole, I kind of couldn't get past how in Red, this would say frame: context? 'n and it would look better. The -OF feels like a "wart".
But the Trello card on LENGTH-OF lays out the facts. e.g. HEAD means give the head of a series, and HEAD? means ask for a LOGIC! of if the series is at its head. So if you say context? system that seems like a yes or no question ("is system a context?") and hence context? 42 should be false.
This got me to wondering if there was some thinking-outside-the-box option which might be a symbolic modifier of the word. context* foo
, context& foo
, anything that wasn't taken already that might look better than -OF (those don't, really). Backed into a corner I thought of this:
- Let
->
be a system-wide naming convention for GET - Let
<-
be a system-wide naming convention for SET
So if you want a shorthand for GET-LENGTH, it's length->. If you want a shorthand for SET-LENGTH, it's <-length.
GET operations tend to be arity-1, and SET operations are arity-2. I'm imagining that with the arrow-notation, the SETs are enfixed and put the thing to set on the left... but evaluated, not quoted.
>> foo: "gets overwritten"
>> word: 'foo
>> word <- 10
>> print foo
== 10
>> foo: 20
>> word: 'foo
>> -> word
== 20
I propose the <- operation be non-tight, so:
>> words: [foo baz bar]
>> first words <- 30
>> print foo
== 30 ;-- words/1 was set to 30, not `words: 30`
What this paints is a picture of a world where you can write property-> as a way of saying GET-PROPERTY. While it may seem that <-property lines up with GET-PROPERTY better, the leftward "flow" of information of <- seems to make it a better SET than a GET. So that means property-> reads something like property/get.
How does it look in practice? I feel it's an improvement:
foo: func [n /accum a] [
case [
not accum [a: 0 | recurse: true]
n = 0 [return a]
]
frame: context-> 'n
n: n - 1
a: a + 2
redo frame
]
This would then free up context? foo as a synonym for what we today call any-context? foo.
It may appear to compete with TAG!, but there are several thoughts on this matter. One thought is my going theory that <-
would not be a valid start of TAG!, nor ->
a valid ending, so you wouldn't have to worry about confusion. Another thought from @rgchris is that being prescriptive about symmetry is silly, as 4chan is not a natural but chan4 is, and so <!-- foo bar -->
can be a tag even if -->
is a standalone WORD! when there's no start tag in effect.
In any case, I guess the point is that I am feeling unsettled with both the Ren-C "-OF warts" and Red's continuation of the non-LOGIC! convention for ?. I don't like either, so I wonder if this idea can lead us out of both traps. And we can reclaim HEAD and TAIL as nouns, e.g. head: head-> s and tail: tail-> s
Note: Previous applications of ->
have been experimented of with things like meaning a lambda generator for functions, e.g. f: x -> [print x] being like f: func [x] [print x]. However, there's other ways of writing that, such as f: x >> [print x] ... or even f: x => [print x] (there's some hope of perhaps reclaiming <= and => as arrows, if people don't see them as comparison operators)