Arturo: "Rebol-inspired" Language

if x=2 -> print "x was 2!"

is the same as writing:

if x=2 [ print "x was 2!" ]

Just remember that -> can wrap only one terminal value.

But how can you calculate how big "one terminal value" is? Especially when it's a branch you are skipping for some reason... quite possibly because the very things needed to run the branch aren't defined?

Pseudocode:

 if function? :foo -> foo bar baz

If foo were a function, then perhaps you could get its arity...and look up bar and if it's a function or terminal, and proceed down the line. But we're trying to skip it because it isn't a function. And nothing guarantees bar is defined either. It's the branch not taken.

You can do this kind of thing in a compiled language where definitions are pinned down and not able to change. But a dynamic interpreted language needs the blocks.

From time to time, people who think saying append/dup [a b] 'c 2 = [a b c c] separates /DUP from its 2 argument, will suggest moving the /DUP to be nearer the 2. They want something like append [a b] 'c /dup 2 or append /dup 2 [a b] 'c.

But this causes trouble when what you supply to those arguments have optional parameters as well. You get into a prioritization question of "whose /dup is that". It means that people adding optional parameters to a function that didn't have that parameter before can break existing code.

We might soon have a working answer to the desire. Due to having an interesting ability to mix TUPLE! and PATH!, I've considered options like:

 append/dup.2 [a b] 'c
 append/dup.n [a b] 'c
 append/dup.(n + 1) [a b] 'c
 append/dup [a b] 'c 2  ; would still be legal

But generic TUPLE!s are new, and the optimizations and formalizations behind PATH!/TUPLE! are new. So it will be some time before that

print user\name

Backslashes are problematic in a lot of scenarios...and if you're passing code fragments around in C strings or to shell scripts it gets pretty ugly.

Characters in Arturo can be declared using backticks: \w

Backticks are another one of those "problem characters", used typically in Markup to call out code. In fact, in the quote above of \w it lost the backticks.

Ren-C got rid of the idea of a separate character type and instead has a non-series string form that is immutable, e.g. ISSUE!. This means #a can act as a character and be asked for its codepoint, but #abc is also in the same family. They're not technically strings so it's not an infinite regression:

>> first "abc"
== #a

>> first #a
== 97  ; codepoint value, so you don't get #a again

I think it's pretty fantastic, and it's especially nice to be able to have so many common characters not require delimiting. #a is very clean.

"inline"

Not using Rebol's name PAREN! is an important thing to reject. Terrible name.

But I think GROUP! is a much better name for (...)

2 Likes