From 9d393f991f3d5f932172029801ed3ba580fce9f9 Mon Sep 17 00:00:00 2001 From: Jon Rafkind Date: Mon, 14 Nov 2011 11:19:37 -0700 Subject: [PATCH] [honu] filter out non-pattern variables --- collects/honu/core/private/macro2.rkt | 6 ++++-- collects/honu/main.rkt | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/collects/honu/core/private/macro2.rkt b/collects/honu/core/private/macro2.rkt index 054258b8e7..a44ff28f17 100644 --- a/collects/honu/core/private/macro2.rkt +++ b/collects/honu/core/private/macro2.rkt @@ -42,7 +42,7 @@ [pattern x #:with result #f]) (syntax-parse original-pattern [(thing:pattern-type ...) - (filter (lambda (x) x) (syntax->list #'(thing.result ...)))])) + (filter (lambda (x) (syntax-e x)) (syntax->list #'(thing.result ...)))])) (provide honu-macro) (define-honu-syntax honu-macro @@ -51,6 +51,7 @@ (syntax-parse code #:literal-sets (cruft) [(_ name literals (#%braces pattern ...) (#%braces action ...) . rest) (debug "Pattern is ~a\n" #'(pattern ...)) + (debug 2 "Pattern variables ~a\n" (find-pattern-variables #'(pattern ...))) (values (with-syntax ([(syntax-parse-pattern ...) (convert-pattern #'(pattern ...))] @@ -68,7 +69,8 @@ ;; instead of x_result. x_result is still there, too (with-syntax ([pattern-variable.name #'pattern-variable.result] ...) - (code ...)) #'more #t)]))))) + (code ...)) + #'more #t)]))))) #'rest #t)]))) diff --git a/collects/honu/main.rkt b/collects/honu/main.rkt index b69a8cc3e5..0251e03a6a 100644 --- a/collects/honu/main.rkt +++ b/collects/honu/main.rkt @@ -23,6 +23,7 @@ null? length substring + void (rename-out [honu-cond cond] [null empty] [current-inexact-milliseconds currentMilliseconds]