[plt-scheme] syntax-case vs. #lang scheme/base

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Thu Oct 16 05:10:31 EDT 2008

If you insert "(require (for-syntax scheme/base))", your error message
"upgrades" to "?bar: pattern variable cannot be used outside of a
template in: ?bar".  Or you could just use "#lang scheme" (which gets
the same results, without the require).

#lang scheme/base

(require (for-syntax scheme/base))

(define-syntax foo
 (lambda (stx)
   (syntax-case stx ()
     ((_ ?bar) ?bar))))

On Thu, Oct 16, 2008 at 4:22 AM, Michael Sperber
<sperber at deinprogramm.de> wrote:
> I'm probably being wayyyy stupid:
> So I'm trying to write some code with #lang scheme/base and syntax-case,
> following the guide, as far as I know:
> #lang scheme/base
> (define-syntax foo
>  (lambda (stx)
>    (syntax-case stx ()
>      ((_ ?bar) ?bar))))
> I get:
> . compile: bad syntax; function application is not allowed, because no #%app syntax transformer is bound in: (lambda (stx) (syntax-case stx () ((_ ?bar) ?bar)))
> Following suggestions from previous posts, I've tried various
> incantations of `require-for-syntax' and `require-for-template', but to
> no avail.
> Help would be much appreciated!
> --
> Cheers =8-} Mike
> Friede, Völkerverständigung und überhaupt blabla

Carl Eastlund

Posted on the users mailing list.