That’s not the job of the macro expander. And the Racket optimizer does reduce (if '#t (#%app not '#f) '#f) — in fact to #t.
If you use Racket CS, try running:
PLT_LINKLET_SHOW_CP0=1 racket file.rkt
where file.rkt is
#lang racket
(displayln (if #t (not #f) #f))
Here’s the optimized program:
;; cp0 ---------------------
(lambda (instance-variable-reference .get-syntax-literal!1
.set-transformer!2 displayln3 print-values4)
(call-with-module-prompt
(lambda ()
(#%call-with-values
(lambda () (displayln3 #t))
print-values4)))
(#2%void))
--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/fce863fe-85d7-44a6-a2ba-5778df40e6bfn%40googlegroups.com.