bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[r6rs] underscore is not a pattern variable and can appear any number of


From: Marco Maggi
Subject: [r6rs] underscore is not a pattern variable and can appear any number of times
Date: Mon, 21 Jun 2010 09:35:41 +0200

The following R6RS program:

(import (rnrs))

(define-syntax ciao
  (lambda (stx)
    (syntax-case stx ()
      ((_ _)
       "ciao\n"))))

(display (ciao 1))

fails with:

;;; note: autocompilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-autocompile argument to disable.
;;; compiling proof.sps
;;; WARNING: compilation of proof.sps failed:
;;; key syntax-error, throw_args (macroexpand "~a: ~a in ~a" (syntax-case 
"duplicate pattern variable" (_ _)) #f)
Backtrace:
In ice-9/boot-9.scm:
 170: 17 [catch #t #<catch-closure 9aa6b20> ...]
In unknown file:
   ?: 16 [catch-closure]
In ice-9/boot-9.scm:
  62: 15 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 389: 14 [eval # #]
In ice-9/boot-9.scm:
1858: 13 [save-module-excursion #<procedure 9b4d840 at ice-9/boot-9.scm:1871:3 
()>]
1149: 12 [load "proof.sps" #f]
1051: 11 [%start-stack load-stack ...]
1056: 10 [#<procedure 9ef01c8 ()>]
In unknown file:
   ?: 9 [primitive-load "proof.sps"]
In ice-9/eval.scm:
 458: 8 [#<procedure 9a28bc0 at ice-9/eval.scm:451:4 (exp)> (define-syntax ciao 
#)]
In ice-9/psyntax.scm:
1195: 7 [chi-top (define-syntax ciao (lambda # #)) () ((top)) ...]
1572: 6 [chi-simple-lambda (lambda (stx) (syntax-case stx () ...)) () ...]
1462: 5 [parse (((# #) . #(syntax-object # # #))) () () () () () ()]
In unknown file:
   ?: 4 [map #<procedure 9f17a08 at ice-9/psyntax.scm:1461:48 (x)> ((# . #))]
In ice-9/psyntax.scm:
2410: 3 [#<procedure 9eae8c0 (_ val key m)> # # () ...]
In unknown file:
   ?: 2 [scm-error syntax-error macroexpand ...]
In ice-9/boot-9.scm:
 115: 1 [#<procedure 999f2f8 at ice-9/boot-9.scm:109:6 (thrown-k . args)> 
syntax-error ...]
In unknown file:
   ?: 0 [catch-closure syntax-error macroexpand ...]

ERROR: In procedure macroexpand:
ERROR: syntax-case: duplicate pattern variable in (_ _)

on     a     i686-pc-linux-gnu     when     using     commit
8d10ccae79ff46f0ebea92ba36acfaebafba8d86.  The underscore is
an  auxiliary syntax,  not  a pattern  variable;  so it  can
appear any number of times in a patter and match any subform
of the input form.
-- 
Marco Maggi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]