Good idea, but can I introduce a new macro (which naturally needs expansion) 
into a fully-expanded module (which does not)?

IOW, it feels like you'd need to mangle #%kernel `if` before expansion, so that 
all the higher level expansions landed on the new mangled form. 

Mangling #%datum won't quite work, because it doesn't know whether the datum is 
being evaluated in a Boolean context. 

Feels like I'm wishing for a `#%boolean` hook that wraps a value that's about 
to be evaluated for its Boolean result. 

> On Jul 1, 2017, at 10:29 AM, Greg Hendershott <greghendersh...@gmail.com> 
> wrote:
> 
> In fully-expanded programs, do all of the desired conditional forms
> reduce to #%kernel `if`?
> 
> If so, could your #%module-begin walk the fully-expanded module syntax
> and replace all the #%kernel `if`s with something like (quick sketch):
> 
> (require (rename-in racket/base [if r:if]))
> (define-syntax-rule (if -e -t -f)
>  (let ([e -e]
>        [f -f])
>    (r:if (eq? e #f)
>          f
>          (r:if (eq? e 0)
>                f
>                (r:if (eq? e null)
>                      f
>                      -t)))))
> 
> ?

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