[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
#1736: Incomplete SRFI-46/R7RS tail pattern support
From: |
Chicken Trac |
Subject: |
#1736: Incomplete SRFI-46/R7RS tail pattern support |
Date: |
Sat, 27 Mar 2021 10:17:46 -0000 |
#1736: Incomplete SRFI-46/R7RS tail pattern support
---------------------------------+----------------------------------
Reporter: wasamasa | Type: defect
Status: new | Priority: minor
Milestone: someday | Component: core libraries
Version: 5.2.0 | Keywords: syntax-rules srfi-46
Estimated difficulty: |
---------------------------------+----------------------------------
I've run into an expansion error when trying to install {{{(chibi
optional)}}}. It's using a tail pattern of the {{{(binding ... . rest)}}}
kind. SRFI-46 only shows one tail pattern example of the {{{((binding ...)
. rest)}}} kind, but R7RS is explicit about allowing both:
{{{
⟨transformer spec⟩ −→
(syntax-rules (⟨identifier⟩*) ⟨syntax rule⟩*)
| (syntax-rules ⟨identifier⟩ (⟨identifier⟩*)
⟨syntax rule⟩*)
⟨syntax rule⟩ −→ (⟨pattern⟩ ⟨template⟩)
⟨pattern⟩ −→ ⟨pattern identifier⟩
| ⟨underscore⟩
| (⟨pattern⟩*)
| (⟨pattern⟩+ . ⟨pattern⟩)
| (⟨pattern⟩* ⟨pattern⟩ ⟨ellipsis⟩ ⟨pattern⟩*)
| (⟨pattern⟩* ⟨pattern⟩ ⟨ellipsis⟩ ⟨pattern⟩*
. ⟨pattern⟩)
| #(⟨pattern⟩*)
| #(⟨pattern⟩* ⟨pattern⟩ ⟨ellipsis⟩ ⟨pattern⟩*)
| ⟨pattern datum⟩
}}}
According to SRFI-46 alexpander does support both patterns just fine, the
error message originates from synrules.scm. I've attached a file with
simplified examples for both the working and not working pattern. I've
also done a brief check across R7RS-compliant Scheme implementations, it
seems that Cyclone doesn't support it either, while Chibi, Kawa, Gauche,
Sagittarius and Foment do.
--
Ticket URL: <https://bugs.call-cc.org/ticket/1736>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.
- #1736: Incomplete SRFI-46/R7RS tail pattern support,
Chicken Trac <=