Re: [r6rs-discuss] Scheme pattern matching R*RS

2011-01-08 Thread Per Bothner
On 12/17/2010 06:34 AM, Jim Wise wrote: * a proper or improper list of N subpatterns with the literal `...` symbol occurring once or more in any position except either the first position of any list, or the last position of an improper list. examples: {{{ (a ... b c)

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-17 Thread Peter Kourzanov
On Fri, 2010-12-17 at 01:47 -0500, John Cowan wrote: I've posted it at http://trac.sacrideo.us/wg/wiki/MatchingWise. I removed the section on exceptions (which is still unsettled) and changed the MUSTard. I've also removed the (rnrs match core) library in favor of just renaming on import. I

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-17 Thread Per Bothner
On 12/17/2010 12:17 AM, Peter Kourzanov wrote: On Thu, 2010-12-16 at 23:42 -0800, Per Bothner wrote: For example this would be mis-parsed in an unexpected manner: (lambda (x y) (list y x)) My definition *is* (I believe) compatible (i.e. a super-set) of traditional lambda. But it

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-17 Thread Jim Wise
One quick correction -- the (removed) (rnrs match core) library renamed match-lambda* - lambda while this edit renames match-lambda. - Lambda which will not work. Sent from my iPhone. Digital signature available upon request. On Dec 17, 2010, at 1:59, John Cowan

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-17 Thread Jim Wise
Per Bothner p...@bothner.com writes: Regardless: (lambda (pat body body ...) (pat body body ...) ...) is incompatible with core:lambda - i.e. it is not a super-set of traditional lambda, and it's not just a matter of rare corner cases. That makes it

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-17 Thread Jim Wise
Jim Wise jw...@draga.com writes: I'd like to propose the following revision: do away with the one-argument special case currently known as match-lambda (this can be easily implemented in terms of the multi-argument case, and make the pattern matching version of lambda take one pattern and

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-17 Thread Jim Wise
Jim Wise jw...@draga.com writes: For consideration, enclosed is an updated version of MatchingWise containing this change, and removing a lingering reference to (rnrs match core) in the introduction. One more quick formatting fix: == Pattern Matching == This is a proposal for a WG2 pattern

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-16 Thread John Cowan
Jim Wise scripsit: Enclosed is the draft I've put together for this. Let me know if you would like me to send this to one or more of the wg or reports lists for further comment. I've posted it at http://trac.sacrideo.us/wg/wiki/MatchingWise. I removed the section on exceptions (which is

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-16 Thread Per Bothner
On 12/16/2010 10:47 PM, John Cowan wrote: I've also removed the (rnrs match core) library in favor of just renaming on import. I think that misses the point - it becomes too much hassle to manually type in the renames, so people aren't going to do it. -- --Per Bothner p...@bothner.com

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-16 Thread John Cowan
Per Bothner scripsit: I think that misses the point - it becomes too much hassle to manually type in the renames, so people aren't going to do it. Ah, but the default names are the overrides, *not* the match- forms. Sneaky, eh? -- John Cowan co...@ccil.org http://ccil.org/~cowan Assent

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-16 Thread John Cowan
Per Bothner scripsit: Cute. But there seems to be a mistake in the definitions of lambda and lambda* - they have the same definitions and expansions in terms of core:lambda. No, the former is defined as (core:lambda (id) ...) and the latter as (core:lambda id ...). The names may well be

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-14 Thread Jim Wise
John Cowan co...@mercury.ccil.org writes: Peter Kourzanov scripsit: Hence my question: what is the state of pattern matching in Scheme? Are there ideas to move this forward, or are we, the poor users, left to live with incompatible pattern matching interfaces and implementations? Working

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-14 Thread John Cowan
Per Bothner scripsit: To win pattern-matching really should be the default and integrated into the language core, rather than an optional module that uses separate keywords. E.g. there shouldn't be a difference between lambda and match-lambda*. The latter is too verbose! Being in the core

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-14 Thread John Cowan
Jim Wise scripsit: Are there plans to include explicit pattern matching operations, such as Common Lisp's DESTRUCTURING-BIND or Racket's match[1]? We don't work in terms of plans, but in terms of proposals, and right now there are no concrete proposals. If you put together a concrete proposal

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-14 Thread Jim Wise
John Cowan co...@mercury.ccil.org writes: Jim Wise scripsit: Are there plans to include explicit pattern matching operations, such as Common Lisp's DESTRUCTURING-BIND or Racket's match[1]? We don't work in terms of plans, but in terms of proposals, and right now there are no concrete

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-14 Thread Jim Wise
Jim Wise jw...@draga.com writes: and derivative forms (match-lambda (pattern body) ...) (match-lambda* (pattern body) ...) (match-let ((pattern expr) ...) which are equivalent to (lambda (x) (match x (pattern body) ...) (lambda l (match l (pattern body)

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-14 Thread John Cowan
Jim Wise scripsit: I'd be willing to cull the list discussion as a proposal, if there seems to be a common thread. Are there any details on what's wanted in such a proposal? Or just the discussion on the list? Any standard formatting? Take a look at

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-14 Thread Per Bothner
On 12/14/2010 06:44 AM, John Cowan wrote: The biggest issue appears to be define. Changing define to have the syntax: (definepattern expression) Why wouldn't it be (define (name .pattern)expression)? A define without an identifier being defined doesn't make much sense to me. I was

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-14 Thread Jim Wise
John Cowan co...@mercury.ccil.org writes: Jim Wise scripsit: I'd be willing to cull the list discussion as a proposal, if there seems to be a common thread. Are there any details on what's wanted in such a proposal? Or just the discussion on the list? Any standard formatting? Take a

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-14 Thread Sam Tobin-Hochstadt
On Tue, Dec 14, 2010 at 12:45 PM, Per Bothner p...@bothner.com wrote: I was thinking in terms of the patterns based on: http://download.plt-scheme.org/doc/372/html/mzlib/mzlib-Z-H-27.html#node_chap_27 That documentation is very old, from December 2007. The current documentation for `match'

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-14 Thread Peter Kourzanov
On Tue, 2010-12-14 at 12:39 -0500, John Cowan wrote: Per Bothner scripsit: The (default/preferred) syntax for lambda should do pattern-matching *without* having to use a verbose name like match-lambda*. I don't want either of these: (1) People learning and using Scheme having to mix 2

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-14 Thread Per Bothner
On 12/14/2010 09:48 AM, Sam Tobin-Hochstadt wrote: On Tue, Dec 14, 2010 at 12:45 PM, Per Bothnerp...@bothner.com wrote: I was thinking in terms of the patterns based on: http://download.plt-scheme.org/doc/372/html/mzlib/mzlib-Z-H-27.html#node_chap_27 That documentation is very old, from

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-14 Thread Sam Tobin-Hochstadt
On Tue, Dec 14, 2010 at 1:09 PM, Per Bothner p...@bothner.com wrote: On 12/14/2010 09:48 AM, Sam Tobin-Hochstadt wrote: On Tue, Dec 14, 2010 at 12:45 PM, Per Bothnerp...@bothner.com  wrote: I was thinking in terms of the patterns based on:

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-14 Thread John Cowan
Per Bothner scripsit: I.e. where (var1 var2 var3) is a valid pattern matching a 3-element list. This syntax for patterns has the advantage that it is a generalization of syntax-rules patterns, in addition to being natural and compact. Ah, I see. I think that the natural extension of define

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-14 Thread Jim Wise
John Cowan co...@mercury.ccil.org writes: Jim Wise scripsit: I'd be willing to cull the list discussion as a proposal, if there seems to be a common thread. Are there any details on what's wanted in such a proposal? Or just the discussion on the list? Any standard formatting? Take a

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-14 Thread Sam Tobin-Hochstadt
On Tue, Dec 14, 2010 at 4:58 PM, Jim Wise jw...@draga.com wrote:  * R6RS case and syntax-case `syntax-parse' by Ryan Culpepper, as described here: http://docs.racket-lang.org/syntax/stxparse.html and here: http://www.ccs.neu.edu/scheme/pubs/#icfp10-cf -- sam th sa...@ccs.neu.edu

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-14 Thread John Cowan
Per Bothner scripsit: There is SRFI 16's case-lambda, but it's pretty simple. Case-lambda is on the table for WG1, and I expect it will most likely pass. That means that if R7RS supports optional arguments then the following (or something functionally equivalent) should be a valid pattern:

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-14 Thread Pied
If we did this, we should also allow GREEK SMALL LETTER LAMBDA.  In fact, it would be preferable, I think, as it has a standard HTML escape: lambda; In my Emacs v23 (Ubuntu Linux), this letter resolved to l (as did the *LAMDA version), not something like 흺 . How did you try to input it? In

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-13 Thread Per Bothner
On 12/12/2010 04:09 PM, John Cowan wrote: Working Group 2 has decided that an optional pattern matching module will be part of R7RS. To win pattern-matching really should be the default and integrated into the language core, rather than an optional module that uses separate keywords. E.g.

Re: [r6rs-discuss] Scheme pattern matching R*RS

2010-12-12 Thread John Cowan
Peter Kourzanov scripsit: Hence my question: what is the state of pattern matching in Scheme? Are there ideas to move this forward, or are we, the poor users, left to live with incompatible pattern matching interfaces and implementations? Working Group 2 has decided that an optional pattern