Re: Re: Threading / Pipe Macro (Chris Vine, Mark H Weaver)

2019-07-09 Thread Zelphir Kaltstahl
s is great! On 7/9/19 11:26 AM, guile-user-requ...@gnu.org wrote: > Date: Tue, 9 Jul 2019 00:00:51 +0100 > From: Chris Vine > To: guile-user@gnu.org > Subject: Re: Threading / Pipe Macro (Chris Vine, Mark H Weaver) > Message-ID: <2019070951.dfaac3839126b7ec58efd...@gm

Re: Threading / Pipe Macro (Chris Vine, Mark H Weaver)

2019-07-09 Thread Linus Björnstam
My macro is was based on the |> pipeline from f# and on the cut macro. I then changed the syntax after seing the pipeline macro in rackjure, which is based on clojure's macros. In the beginning I wanted to do destructuring as well to allow to destructure lists and passed it as numbered argument

Re: Threading / Pipe Macro (Chris Vine, Mark H Weaver)

2019-07-09 Thread Chris Vine
On Tue, 09 Jul 2019 11:40:02 +0200 Linus Björnstam wrote: > Sorry, I didn't see that macro. I was referring to my macro that Erik > linked to [1], which is a syntax rules macro that also allows for <> > argument placeholders: > > (~> 1 1+ (/ 10 <>) iota (+ <...>)) => 10 > > It defaults to left i

Re: Threading / Pipe Macro (Chris Vine, Mark H Weaver)

2019-07-09 Thread Linus Björnstam
Sorry, I didn't see that macro. I was referring to my macro that Erik linked to [1], which is a syntax rules macro that also allows for <> argument placeholders: (~> 1 1+ (/ 10 <>) iota (+ <...>)) => 10 It defaults to left insert, so (~> 10 (/ 2)) => 5 but also (like the syntax rules macro i

Re: Threading / Pipe Macro (Chris Vine, Mark H Weaver)

2019-07-09 Thread Chris Vine
On Tue, 09 Jul 2019 08:01:01 +0200 Linus Björnstam wrote: > On Tue, 9 Jul 2019, at 01:02, Chris Vine wrote: > > On Mon, 8 Jul 2019 23:10:28 +0200t > > Zelphir Kaltstahl wrote: > > > Hello Chris and hello Mark, > > > > > > Thank you both for posting your macros! This is really useful and I am > >

Re: Threading / Pipe Macro (Chris Vine, Mark H Weaver)

2019-07-08 Thread Linus Björnstam
The comparison is also not really fair. The syntax-rules macro is doing a lot more. A simple syntax-rules macro just inserting everything in the leftmost position would loo something like (define-syntax -> (syntax-rules () ((-> exp) exp) ((-> exp (proc args ...) rest ...) (-> (proc exp

Re: Threading / Pipe Macro (Chris Vine, Mark H Weaver)

2019-07-08 Thread Chris Vine
On Mon, 8 Jul 2019 23:10:28 +0200t Zelphir Kaltstahl wrote: > Hello Chris and hello Mark, > > Thank you both for posting your macros! This is really useful and I am > looking forward to using this in the next situation where there would be > deep nesting or where it seems appropriate in other way

Re: Threading / Pipe Macro (Chris Vine, Mark H Weaver)

2019-07-08 Thread Zelphir Kaltstahl
Hello Chris and hello Mark, Thank you both for posting your macros! This is really useful and I am looking forward to using this in the next situation where there would be deep nesting or where it seems appropriate in other ways. To understand what is going on in the macro, I wrote a lot of expla