On 12/14/2010 06:44 AM, John Cowan wrote:
>> 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.

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

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.

In that case, how do you distinguish:

   (define (function-name param1 param2) <expression>)

from

   (define (var1 var2 var3) <expression>)

>>     (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.

Right - but if we used a short keyword and added support for patterns,
that would help encourage this style, which I think would be an improvement.
-- 
        --Per Bothner
[email protected]   http://per.bothner.com/

_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to