[plt-scheme] Non-syntax-rules macros in scheme/base

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Sat Oct 11 21:28:29 EDT 2008

#lang scheme/base
;; You need to add the following line:
(require (for-syntax scheme/base))

(provide test)

(define-syntax test
 (lambda (stx)
   #'2))

On Sat, Oct 11, 2008 at 9:12 PM, Henk Boom <lunarc.lists at gmail.com> wrote:
> The following works:
> #lang scheme
>
> ---
> #lang scheme
>
> (provide test)
>
> (define-syntax test
>  (lambda (stx)
>    #'2))
> ---
> henk at korhal ~ $ mzscheme -i -t test.ss
> Welcome to MzScheme v4.1 [3m], Copyright (c) 2004-2008 PLT Scheme Inc.
>> (test)
> 2
> ---
>
> However, if I switch the above to use #lang scheme/base, I get the following:
>
> ---
> henk at korhal ~ $ mzscheme -i -t test.ss
> Welcome to MzScheme v4.1 [3m], Copyright (c) 2004-2008 PLT Scheme Inc.
> test.ss:6:2: compile: bad syntax; function application is not allowed,
> because no #%app syntax transformer is bound in: (lambda (stx) (syntax
> 2))
> ---
>
> Is this a bug, or is there something in #lang scheme which I need to
> require when using #lang scheme/base?
>
> Thanks,
>    Henk


Posted on the users mailing list.