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

Re: SRFI 105: Curly-infix-expressions

This page is part of the web mail archives of SRFI 105 from before July 7th, 2015. The new archives for SRFI 105 contain all messages, not just those from before July 7th, 2015.

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.

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