Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Rebol's default dialect (the <code>do</code> 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:</p> <pre><code>tweet [Hello World How Are You Today?] </code></pre> <p>But the idea of using <code>word!</code> instead of <code>string!</code> in this case is a little dodgy, as many common tweets aren't valid for the Rebol parser:</p> <pre><code>tweet [LOL! :)] </code></pre> <p>Neglecting that issue, note that by default you won't get any expression evaluation. So this <code>tweet</code> 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:</p> <pre><code>&gt;&gt; a: 10 &gt;&gt; b: 20 &gt;&gt; tweet [When you add :a and :b you get (a + b), LOL ":)"] "When you add 10 and 20 you get 30, LOL :)" </code></pre> <p>BTW, <code>take-n</code> 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:</p> <pre><code>do [do (take-n 4) 1 2 3 4] </code></pre> <p><code>take-n</code> 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:</p> <pre><code>do [f 1 2 3 4] </code></pre> <p>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.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload