From b4588a7767cc47bf4f37169fb80f0385835bdd72 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Mon, 9 Jul 2018 15:10:36 -0600 Subject: [PATCH] shorten --- beautiful-racket-demo/pythonesque-demo/main.rkt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/beautiful-racket-demo/pythonesque-demo/main.rkt b/beautiful-racket-demo/pythonesque-demo/main.rkt index d4d44ab..16bfb4e 100644 --- a/beautiful-racket-demo/pythonesque-demo/main.rkt +++ b/beautiful-racket-demo/pythonesque-demo/main.rkt @@ -67,13 +67,12 @@ (define-macro block #'begin) (provide (rename-out [my-if if])) -(define-macro-cases my-if - [(_ COND TBLOCK) #'(when COND TRUE-BLOCK)] - [(_ COND TBLOCK FBLOCK) #'(if COND (let () TBLOCK) (let () FBLOCK))]) +(define-macro (my-if COND TBLOCK FBLOCK) + #'(if COND (let () TBLOCK) (let () FBLOCK))) (define (read-syntax src ip) (define parse-tree (parse (λ () (lex ip)))) (strip-context (with-syntax ([PT parse-tree]) - #'(module _ pythonesque-demo + #'(module pyname pythonesque-demo PT)))) \ No newline at end of file