> Yes, thank you for mentioning them. I was actually thinking of starting with 
> SXML, but then turning it into a list of string fragments (with spaces left 
> for the dynamically generated parts) as a simplification step once I've 
> figured out where everything goes. But there are other languages besides HTML 
> this is relevant for.
> 
> (define (query condA condB (limit #f) (offset #f))
>   (list "SELECT something FROM table WHERE "
>               condA
>               " AND "
>               condB
>               (if limit
>                       (list "LIMIT " limit
>                                 (if offset
>                                         (list "OFFSET " offset)
>                                         '()))
>                       '())))
> 
> for instance.

Of course, you can also use the `at-exp` metalanguage from Scribble to simplify 
text-heavy constructions like these, with variables interpolated into strings:

#lang at-exp racket

(define (query condA condB (limit #f) (offset #f))
  @~a{SELECT something FROM table WHERE @condA AND @condB @(if limit
                                                               @~a{LIMIT @limit 
@(if offset
                                                                                
     @~a{OFFSET @offset}
                                                                                
     "")}
                                                               "")})

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to