| Certainly: I can tell the rye devs like the idea of everything being a function. But in their very first "language basics" section, they introduce assignment not as a function call, but as some kind of magic that happens when you have colons in a name. So when we get to the "looping" section, it is the first time we have seen a colon-having-name outside the context of assignment: > loop 3 { ::i , prns i } And it is explained that the above line of code is "injecting" values for the code block to "pick up". But right away this begs a number of questions: * Why the double-colon? I would assume each loop-body-evaluation happens in its own scope, and that we're not creating global variables, so a single colon (:i) should be sufficient, right? * What are we doing, conceptually? Is the ::i meant to be "a function which when given a value modifies its enclosing scope to include the symbol i" or "an unassigned symbol which the loop function will use to do something akin to term-rewriting with?" * Do we really need a symbol at all, or could we just have a the point-free loop "loop 3 {prns}"? * If we can't have the point free thing, is it because somehow the injected value would end up "to the left" of prns, if so, why would we want that? * If we're doing something more like term rewriting, why isn't the symbol given as a separate argument from the body? |
`word` - regular word, can evaluate to value it's bound to or call a funtion if bound to a function
`word: "value"` - set-word, assignment that you noticed
`probe :word` - get-word, always returns bound value, doesn't call a function if it's bound to a function, in Rye this is `?word`, because `:word` is left-set-word.
`'word` - literal word, evaluates to a word itself
etc ...
Rye adds even more word types. Rye also has left to right flow so it adds left-set-word. In Rye all assigned words with set-words are constants and they are used by default. So we also need a "mod-word", that is the double colon that you noticed, and left-mod-word. Because of left-to-right flow Rye also has .op-words and |pipe-words.
The logic around words, op-words and pipe-words ... I tried to explain here:
https://ryelang.org/meet_rye/specifics/opwords/
Another pattern you noticed (good observation btw:) is the idea of injected blocks that isn't used just for loops, but also for conditionals, function bodies, HOF-like functions etc ...
https://ryelang.org/meet_rye/specifics/injected_blocks/
All in all it is supposed to be a compact set of ideas that fit together. Some are somewhat unusual.