On Sat, Aug 4, 2018 at 3:18 PM, Sanjeev Sharma <throw...@gmail.com> wrote:
> but as long as one is defaulting #:unless > PLUS #unless is common to all the for's across some arbitrary scope, > ideally one could elide it from each of the for's within that scope. > Local macros might be part of what you want: #lang racket (define (f unless?) (define-syntax-rule (for/sum/unless ([id rhs] for-clause ...) body ...) (for/sum ([id rhs] #:unless (unless? id) for-clause ...) body ...)) (list (for/sum/unless ([x '(1 2 3 4 5)]) x) (for/sum/unless ([y '(6 7 8 9 10)] [2y (in-value (* 2 y))]) (displayln y) (add1 2y)))) (f odd?) (f even?) -- 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.