unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Marco Maggi <marco.maggi-ipsu@poste.it>
To: bug-guile@gnu.org
Subject: [r6rs] underscore is not a pattern variable and can appear any number of times
Date: Mon, 21 Jun 2010 09:35:41 +0200	[thread overview]
Message-ID: <87hbkw4z3m.fsf@rapitore.luna> (raw)

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	other threads:[~2010-06-21  7:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-21  7:35 Marco Maggi [this message]
2010-06-21 19:07 ` [r6rs] underscore is not a pattern variable and can appear any number of times Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87hbkw4z3m.fsf@rapitore.luna \
    --to=marco.maggi-ipsu@poste.it \
    --cc=bug-guile@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).