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

Re: Initial comments & questions

This page is part of the web mail archives of SRFI 53 from before July 7th, 2015. The new archives for SRFI 53 contain all messages, not just those from before July 7th, 2015.



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....