Rebol's default dialect (the do
dialect) does not support the notion of a call to a function having a variable number of arguments. If you want to break a rule as fundamental as this, then you need your own dialect. Nothing stopping you from making:
tweet [Hello World How Are You Today?]
But the idea of using word!
instead of string!
in this case is a little dodgy, as many common tweets aren't valid for the Rebol parser:
tweet [LOL! :)]
Neglecting that issue, note that by default you won't get any expression evaluation. So this tweet
dialect would have to choose a way to show where you want an evaluation. You might use get-word elements to do variable substitution, and parentheses for more general evaluations:
>> a: 10
>> b: 20
>> tweet [When you add :a and :b you get (a + b), LOL ":)"]
"When you add 10 and 20 you get 30, LOL :)"
BTW, take-n
in Rowland's example isn't returning a block. Not directly, I mean. It's perhaps better understood with parentheses, and by addressing the implicit "do" that's there on every interpretation:
do [do (take-n 4) 1 2 3 4]
take-n
works with only one parameter (the "n") and then returns a function which takes n parameters. Let's call that function f, so step one of this evaluation turns into something equivalent to:
do [f 1 2 3 4]
When the second do kicks in, that function gets run...and it's returning a block. In practice, I doubt you're going to want to be counting the parameters like this.