From 4a29ce914f6484a4415f1abb46aa0f5d70469a8d Mon Sep 17 00:00:00 2001 From: Ryan Culpepper Date: Tue, 14 Sep 2010 12:20:34 -0600 Subject: [PATCH] and, or now wrap single term with #%expression That disallows things like (and (define x 1)), previously accepted. --- collects/racket/private/qq-and-or.rkt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/collects/racket/private/qq-and-or.rkt b/collects/racket/private/qq-and-or.rkt index 226dc72022..37bbf3dc4f 100644 --- a/collects/racket/private/qq-and-or.rkt +++ b/collects/racket/private/qq-and-or.rkt @@ -400,7 +400,11 @@ (if (if (stx-pair? e) (stx-null? (stx-cdr e)) #t) - (stx-car e) + (datum->syntax + here + (list (quote-syntax #%expression) + (stx-car e)) + x) (datum->syntax here (list (quote-syntax if) @@ -422,7 +426,11 @@ (if (if (stx-pair? e) (stx-null? (stx-cdr e)) #f) - (stx-car e) + (datum->syntax + here + (list (quote-syntax #%expression) + (stx-car e)) + x) (if (stx-list? e) (let-values ([(tmp) 'or-part]) (datum->syntax