[REBOL] Re: DyBASE test
From: rotenca:telvia:it at: 24-Dec-2003 13:45
Hi, Konstantin Knizhnik
> make object! [
> close: ["close database"] [dybase_close db]
> Which word do you want to protect? "close"?
> It has to be defined...
> The bug is that word "func" is missed, so instead of method definition
> this code is treated by Rebol as initialization of "close" field with
> block ["close database"]. What compiler does with second block is not
> clear to me, I think it was just skipped.
No, it is evaluated and the evaluation of a block is the block itself.
make object! [close: ["close database"] print 1]
make object! [close: ["close database"] (print 1)]
The body block of an object is simply evaluated, as-is:
make object! [print 1]
If the interpreter should warn for every evaluated block, you could not do:
pick [1 2 3] 2
without a warning, because [1 2 3] is evaluated before passing it to the
The point here is that there is no difference between code and data in Rebol.
And that can be detected only at run time.
An help for the programmer could be a /debug mode for the interpreter which
outputs a list of warning during execution, but we have only the trace mode
Romano Paolo Tenca