[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Initial comments & questions



On Sun, 21 Mar 2004, Andre van Tonder wrote:

> Taylor's debug messages.  For example:
> 
>   (syntax-do (x <- ......)
>              (syntax-message "The intermediate result is:" x)
>              (syntax-if (atom? x)
>                (syntax-do (syntax-warning "Atoms may explode if split")
>                           (y <- ......)
>                           (syntax-message "y = " y)
>                           (z <- ......)
>                        .
>                        . 
>          
> Note that this would be an argument for keeping both the current <- arrows
> and the current indentation and bracketing.

Another possibility:

1) Indeed use syntax-bind, only for sequential bindings a la let*:

   (syntax-bind ((x (syntax-return (1 2 3)))
                 (y (syntax-reverse x)) 
                 (z (syntax-reverse y)))
     (syntax-return z))

2) Perhaps in future have syntax-begin for imperative 
   things like syntax-debug-message.  The above syntax-do example becomes

  (syntax-bind ((x (.......)))
    (syntax-begin
      (syntax-debug-message "Intermediate result = " x)
      (syntax-bind ((y (.....)))
        (syntax-if (syntax-atom? x)
                   (syntax-begin
                     (syntax-warning "Atoms may explode if split")
                     (syntax-begin (y (......))
                       (syntax-begin (syntax-debug-message "y = " y)
                                     (syntax-bind (z (.......))
                   .
                   .

    This is arguably more Schemely, but it is a royal pain to 
    add debug messages this way....