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 and being spelled "lambda" are orthogonal points.  The
module can say (export (rename match-lambda* lambda)) and then importers
will get the pattern-matching lambda, or they themselves can import it as
(import (rename (scheme patterns) (match-lambda* lambda))).  In a world
of import and export renaming, the precise name of a procedure or syntax
keyword is no longer much of an issue.

> At the least we could have a standard library that redefines the
> standard keywords lambda, let, ... etc to versions that support
> patterns.

Exactly.

> The biggest issue appears to be define.  Changing define to have
> the syntax:
>    (define <pattern> <expression>)

Why wouldn't it be (define (<name> . <pattern) <expression>)?  A define
without an identifier being defined doesn't make much sense to me.

>    (begin
>      (def var1 exp1)   ;; OR: (::= var1 exp1) etc (def var2 exp2)
>      (def varn expn)

Reading 'define' for 'def', this looks like R5RS to me.  We only use
'let' out of habit, really; nine times out of ten, the definitions are
independent, and any of 'let', 'let*', 'letrec', or internal 'define'
(aka 'letrec*') will work.

-- 
John Cowan  co...@ccil.org    http://ccil.org/~cowan
No man is an island, entire of itself; every man is a piece of the
continent, a part of the main.  If a clod be washed away by the sea,
Europe is the less, as well as if a promontory were, as well as if a
manor of thy friends or of thine own were: any man's death diminishes me,
because I am involved in mankind, and therefore never send to know for
whom the bell tolls; it tolls for thee.  --John Donne

_______________________________________________
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to