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

*To*: John Cowan <cowan@x>*Subject*: Re: [Scheme-reports] editorial awkwardness for syntax-rules pattern-matching*From*: Per Bothner <per@x>*Date*: Wed, 03 Sep 2014 17:47:34 -0700*Cc*: scheme-reports <scheme-reports@x>*In-reply-to*: <20140903234055.GC4855@mercury.ccil.org>*References*: <54077D8B.6000000@bothner.com> <20140903234055.GC4855@mercury.ccil.org>

On 09/03/2014 04:40 PM, John Cowan wrote: > Per Bothner scripsit: > >> Much clearer to write: >> >> P is of the form (P_1 . . . P_k P_e ellipsis P_k+1 ... P_k+l) >> where E is a proper list of n elements, the first >> k of which match P_1 through P_k , respectively, whose >> next n−k-l elements each match P_e, whose remaining >> l elements match P_k+1 through P_k+l > > I don't see where the aditional clarity comes in; Well, in my opinion 'P is of the form (P_1 . . . P_k P_e ellipsis P_m+1 ... P_n)' is somewhat nonsensical. Where do m and n come from? n is the length of E, but m is complicated to describe as it depends on both n and the number of patterns in P following the ellipsis. This seems a rather unusual way to enumerate items in a list. Using l (or m) for the number of sub-patterns following the ellipsis is much easier to understand: l is just the number of sub-patterns following the ellipsis, and this is obvious from the form P_k+1 ... P_k+l. > also, having both 1 and l in a formula is asking for trouble. That occurred to me. Using m in place of l is one option. Even better if we're willing to use other letters beside P for sub-patterns: P is of the form (P_1 . . . P_k Q ellipsis R_1 ... R_m) where E is a proper list of n elements, the first k of which match P_1 through P_k , respectively, whose next n−k-m elements each match Q, whose remaining m elements match R_1 through R_m -- --Per Bothner per@x http://per.bothner.com/ _______________________________________________ Scheme-reports mailing list Scheme-reports@x http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports

**References**:**[Scheme-reports] editorial awkwardness for syntax-rules pattern-matching***From:*Per Bothner <per@x>

**Re: [Scheme-reports] editorial awkwardness for syntax-rules pattern-matching***From:*John Cowan <cowan@x>

- Prev by Date:
**Re: [Scheme-reports] Proposed new SRFI for immutable lists** - Next by Date:
**Re: [Scheme-reports] Proposed new SRFI for immutable lists** - Previous by thread:
**Re: [Scheme-reports] editorial awkwardness for syntax-rules pattern-matching** - Next by thread:
**Re: [Scheme-reports] editorial awkwardness for syntax-rules pattern-matching** - Index(es):