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

Re: SRFI 105: Curly-infix-expressions



On Tue, Aug 28, 2012 at 12:58 AM, Shiro Kawai <shiro@xxxxxxxx> wrote:
> From: Alan Manuel Gloria <almkglor@xxxxxxxxx>
> Subject: Re: SRFI 105: Curly-infix-expressions
> Date: Mon, 27 Aug 2012 15:58:36 +0800
>
>> The way the current spec is done allows for code like the
>> following:
>>
>> (define {a // b}
>>   {(unwrap-par-monad a) parallel (unwrap-par-monad b)})
>
> Kind of cute, though I wonder if this can be extended
> to handle variable arity operators.

David A. Wheeler and me kinda considered the following
transformation:

{ x a . y } => (a x . y)

The proposal was that the "list length" operation would
consider improper lists to be of size 1, so {x a . y} would
be considered an odd length, at least 3, etc. basically
triggering the "simple" rule.


>
>> (define-syntax o
>>   (syntax-rules ()
>>     ({a o b}
>>       (lambda (x) (b (a x))))
>>     ({a o b o rest o ...}
>>      {{a o b} o rest o ...})))
>>
>> Again, this takes advantage of the fact that
>> {a o b o rest o ...} means (o a b rest ...)
>
> This is also cute, though it effectively changes the
> surface meaning of "x ...".
>
> These two examples are interesting.  They don't appeal to me
> enough to convince me non-macro approach is good, but others
> may feel differently.  How about including them in the rationale
> section to explain why reader transformation is necessary?
>
> --shiro

Yes, I probably should.

Sincerely,
AmkG