unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* [r6rs] underscore is not a pattern variable and can appear any number of times
@ 2010-06-21  7:35 Marco Maggi
  2010-06-21 19:07 ` Andy Wingo
  0 siblings, 1 reply; 2+ messages in thread
From: Marco Maggi @ 2010-06-21  7:35 UTC (permalink / raw)
  To: bug-guile

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [r6rs] underscore is not a pattern variable and can appear any number of times
  2010-06-21  7:35 [r6rs] underscore is not a pattern variable and can appear any number of times Marco Maggi
@ 2010-06-21 19:07 ` Andy Wingo
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Wingo @ 2010-06-21 19:07 UTC (permalink / raw)
  To: Marco Maggi; +Cc: bug-guile

On Mon 21 Jun 2010 09:35, Marco Maggi <marco.maggi-ipsu@poste.it> writes:

>     (syntax-case stx ()
>       ((_ _)

Fixed in master, thanks for the report. It is an incompatible change in
R6RS, but I think it's for the better.

Ciao,

A
-- 
http://wingolog.org/



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-21 19:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-21  7:35 [r6rs] underscore is not a pattern variable and can appear any number of times Marco Maggi
2010-06-21 19:07 ` Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).