Hi Tony,

There are several classical ways of debugging REBOL, but -not talking about 'trace- 
they are all 'print-like: take a look at ?, ?? and probe.

>> ? ??
USAGE:
    ?? 'name

DESCRIPTION:
     Prints a variable name followed by its molded value. (for debugging)
     ?? is a function value.

ARGUMENTS:
     name -- (Type: any)
>> ? ?
USAGE:
    ? 'word

DESCRIPTION:
     Prints information about words and values.
     ? is a function value.

ARGUMENTS:
     word -- (Type: any-type)
>> ? probe
USAGE:
    PROBE value

DESCRIPTION:
     Prints a molded, unevaluated value and returns the same value.
     PROBE is a function value.

ARGUMENTS:
     value -- (Type: any)

We are using a more sophisticated way of debugging, although also 'print-like.
We place some specific debug-instructions within the code, according the effect we 
want to reach: examine the content of a word, set a mark, evaluate some code, stop the 
evaluation of the script, etc.... The interesting part is that those 
debug-instructions are like comments, so they don't interact with the script when 
evaluated or encapsulated:

        1. your script...
            at the place you want a debug action:
            ;$debug           => gives value of all user words
            ;$debug/var 'var1 => gives only value of var1
            ;$debug/var [var1 var2] => gives only value of var1 & var2
            ;$debug/stop => request pause after displaying var value
            ;$debug/eval [some rebol code] ;=> eval code into block
            ;$debug/prn 'var or [var] ;=> print the molded value
            ;$debug/mark 'val ;=> set a milestone
                (use /exe as alone refinement !)
        2. calling the debug script...
            from the console:  
            do/args %debug.r %yourscript.r
                        or
            do %debug.r   => the file to debug will be requested     

We use it daily in our developments :)
I could provide you a copy if you are interested. Just send me your email.

Regards,

==christophe
[EMAIL PROTECTED]

> -----Original Message-----
> From: Anthony B. Coates [mailto:[EMAIL PROTECTED]
> Sent: samedi 1 mai 2004 12:31
> To: [EMAIL PROTECTED]
> Subject: [REBOL] How best to debug REBOL?
> 
> 
> 
> I'm sure this is an FAQ (so apologies in advance), but I 
> haven't found an 
> answer in any of the FAQs.  Is there an interactive way of debugging 
> REBOL, or any way beyond adding print statements?  I'm trying to 
> understand the workings of the REBOL CGI scripts for a 
> blog/weblog app 
> called "Vanilla", and I would like to be able to step through the 
> execution line by line and see what the values are at each stage.
> 
> So, if anyone can give me any pointers, I would be grateful.  
> I'm just 
> concerned I've missed something painfully obvious.  Thanks in advance,
> 
>       Cheers,
>               Tony.
> -- 
> To unsubscribe from this list, just send an email to
> [EMAIL PROTECTED] with unsubscribe as the subject.
> 
> 

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.

Reply via email to