2017-07-24 16:55 GMT+02:00 Panicz Maciej Godek <xxxxxx@gmail.com>:
P.S.: I am willing to help you with the sample implementation if you
want to incorporate some of my suggestions (e.g. "_" is position 3 or
later, or to code the "let"-wrappers) and if you don't like macro
programming too much (or take a look at SRFI 148, which makes
programming or powerful macros very easy).
I think can deal with "let" wrappers rather easily, but I'd love to see a straightforward
solution for "_" in position 3 or later (I have an idea how to do this with syntax-rules,
but it would require an auxiliary macro to decide whether the "_" symbol appears
anywhere in the expression. It's not very complex, but I'm not sure whether it is
actually worth it)

HI Marc,
I tried to implement your suggestions, but apparently my implementation breaks
the identity of the "_" symbol now.
I also changed the behaviour slightly, so that uses like

(is x < y even?)

are also allowed -- this would expand to

(let ((y* y))
  (and (< x y*) (even? y*)))

I'm not convinced whether it's a great idea, but I don't think it hurts either. The advantage
is that it allows for a slightly more coherent implementation, but I am willing to get rid
of that eagerly if anyone protests.

So anyway, I include a *broken* implementation that was meant to support underscore
in any position, but apparently doesn't support underscore at all. If you were willing
to help me with that, I'd be grateful.