Ladislav,

I'd be delighted to have you proofread anything I write; you have a
keen eye!

[EMAIL PROTECTED] wrote:
> 
> ... quoting from a manual page ... 
> {{
> Evaluating Blocks
> Blocks are not normally evaluated. They are normally treated as data.
> Typing:
> 
> [1 + 2]
> 
> will return the same block. No evaluation would happen.
> To evaluate a block, you use the do function:
> 
> do [1 + 2]
> }}
> 
> The latter seems to be in contradiction with what was said under 1) 2) or
> 3).
> 
> Solution:
> 
> a) There is a possibility to overlook the discrepancy and be happy with the
> current state.
>

Sounds like a BAD idea to me.

>
> b) The following seems preferable to me:
> 
> (i) Rebol blocks, lists, hashes, strings evaluate to themselves.
> 
> (ii) The correct description of Do:
> 
> Do is a function that interprets it's argument as a Rebol code. (don't mix
> this with evaluation)
> 

What would you think of this alternative?

   Do is a function that interprets its argument as REBOL code.

   If the argument is a string, it is first translated to a block,
   which do then interprets as follows.

   If the argument is a block, do causes the contents of the block
   to be evaluated.

   Remember that "wrapping" words in a block prevents their
   evaluation, so that the words in

      >> a: now/time print a
      13:35:04

   are immediately evaluated, but not when placed inside a block

      >> b: [a: now/time print a]
      == [a: now/time print a]

   which simply evaluates to itself

      >> b
      == [a: now/time print a]

   However, do essentially "unwraps" a block, causing its contents
   to be evaluated

      >> do b
      13:35:38

   The same is true for a string, which evaluates to a sequence of
   characters
  
      >> b: "a: now/time print a"
      == "a: now/time print a"

   but can be translated into a block

      >> load b
      == [a: now/time print a]

   or interpreted after being translated into a block

     >> do b
     13:35:55

I know I bulked up the text by being so detailed with the examples,
but it seems accurate to me that we could describe do as

   "evaluates the contents of its argument"

as distinct from "evaluates its argument", and thereby resolve the
discrepancy you pointed out earlier.

>
> Advantages:
> 
> More coherent documentation.
> 
> Disadvantages:
> 
> The need to rewrite doc's.
> 

...which, if they are incorrect/incomplete, need to be rewritten
anyway (at least the sections involved).

Just my $0.02

-jn-

Reply via email to