Re: New egg: CHICKEN Transducers

2023-01-15 Thread Tomas Hlavaty
Hi Jeremy, thank you for your detailed response. On Fri 13 Jan 2023 at 17:56, Jeremy Steward wrote: >> On Wed 04 Jan 2023 at 18:48, Jeremy Steward wrote: >>> >> >> My main problem with generators and accumulators is

Re: New egg: CHICKEN Transducers

2023-01-13 Thread Jeremy Steward
On 1/11/23 16:20, Tomas Hlavaty wrote: Hi Jeremy, thank you for interesting reading. Thank you for taking the time to go through it :) On Wed 04 Jan 2023 at 18:48, Jeremy Steward wrote: My main problem with

Re: New egg: CHICKEN Transducers

2023-01-11 Thread Tomas Hlavaty
Hi Jeremy, thank you for interesting reading. On Wed 04 Jan 2023 at 18:48, Jeremy Steward wrote: > My main problem with generators and accumulators is that they basically replace all our existing data types with a

Re: New egg: CHICKEN Transducers

2023-01-10 Thread Jeremy Steward
Hey! These are some interesting changes, let me go through them bit-by-bit: On 1/9/23 11:45, siiky wrote: [^1]: This can be easily remied if the sentinel is given to the collect instead of the transduce, in which case the current def of transduce is a single case-lambda case instead of two:

Re: New egg: CHICKEN Transducers

2023-01-09 Thread siiky
Hiya, This wouldn't work very well with the current API in Scheme, because the fold is passed to transduce explicitly.  And given that, either a restriction must be imposed on the input data structures (they must all be of the same type); or the folder of each input data structure must be

Re: New egg: CHICKEN Transducers

2023-01-06 Thread siiky
For one, that's not the same code. :p The SRFI 42 code I showed loops over all possible pairs, doesn't zip the inputs. Just occured to me that I could put one transducer inside the other, something like this: (transduce list-fold (map (lambda (x) (transduce

Re: New egg: CHICKEN Transducers

2023-01-06 Thread siiky
On 1/5/23 06:11, siiky wrote: I think the easiest way for this would be to just zip the list together: (transduce list-fold (compose (zip-list lst2) (filter (lambda (p) (even? (* (car p) (cdr p))

Re: New egg: CHICKEN Transducers

2023-01-06 Thread siiky
(...) My reasoning is that (intuitively, without having looked at an impl of either) type-fold is easier to implement than type-transduce (...) Indeed, and this has been the reasoning in why I have left it for the most part. An egg like this is nothing if it cannot be extended easily.

Re: New egg: CHICKEN Transducers

2023-01-06 Thread Moritz Heidkamp
Hi, On 5 January 2023 18:48 -07, Jeremy Steward wrote: > On 1/5/23 06:11, siiky wrote: > I think the easiest way for this would be to just zip the list together: > > (transduce list-fold > (compose > (zip-list lst2) > (filter (lambda (p)

Re: New egg: CHICKEN Transducers

2023-01-05 Thread Chris Brannon
Jeremy Steward writes: > 2. Macro-based: This makes it pretty difficult to extend, especially > if you don't have a clear "standard" or "winning" data structure that > the community can rely on. Not that it's impossible, but I'd have an > easier time as a user writing a custom fold procedure

Re: New egg: CHICKEN Transducers

2023-01-05 Thread Jeremy Steward
On 1/5/23 09:45, Walter Lewis wrote: On 1/4/23 8:48 PM, Jeremy Steward wrote: And I've written a short blog post outlining some of my frustrations that led me to writing this egg: Happy to engage with the rest of the

Re: New egg: CHICKEN Transducers

2023-01-05 Thread Jeremy Steward
On 1/5/23 05:49, siiky wrote: Awesomesauce, thanks for the egg and the post! This is a smnall-ish pain point of mine too. I'm still processing the post as well, but I can tell I'll start using this frequently! That's great to hear. I appreciate that you enjoyed the post and will start using

Re: New egg: CHICKEN Transducers

2023-01-05 Thread Jeremy Steward
On 1/5/23 06:11, siiky wrote: There are some things I would still use SRFI 42 for, at least for now that I'm new to transducers. For example: (list-ec (:list x lst1) (:list y lst2) (if (even? (* x y))) (cons x y)) Which is similar to (filter even (map * lst1

Re: New egg: CHICKEN Transducers

2023-01-05 Thread Jeremy Steward
On 1/5/23 04:22, Chris Brannon wrote: Jeremy Steward writes: And I've written a short blog post outlining some of my frustrations that led me to writing this egg: That was a fantastic post. I'm still digesting it.

Re: New egg: CHICKEN Transducers

2023-01-05 Thread Jeremy Steward
On 1/5/23 00:44, Peter Bex wrote: And I've written a short blog post outlining some of my frustrations that led me to writing this egg: Excellent observations, especially regarding the fold argument inconsistency, that's

Re: New egg: CHICKEN Transducers

2023-01-05 Thread Walter Lewis
On 1/4/23 8:48 PM, Jeremy Steward wrote: And I've written a short blog post outlining some of my frustrations that led me to writing this egg: Happy to engage with the rest of the community on what the next priority for

Re: New egg: CHICKEN Transducers

2023-01-05 Thread siiky
How about SRFI 42? I wrote a little bit in #chicken but think it should be added here as well. Pros of SRFI 42: + It's short and clear. It feels very natural to me. Maybe just because I've used it for some time while I've just been introduced to transducers now, but I have the impression

Re: New egg: CHICKEN Transducers

2023-01-05 Thread siiky
Awesomesauce, thanks for the egg and the post! This is a smnall-ish pain point of mine too. I'm still processing the post as well, but I can tell I'll start using this frequently! First a couple of typos: In footnote 4 it should be `call/cc` and not `call-cc`? And "its not the Scheme I reach

Re: New egg: CHICKEN Transducers

2023-01-05 Thread Chris Brannon
Jeremy Steward writes: > And I've written a short blog post outlining some of my frustrations > that led me to writing this egg: > > That was a fantastic post. I'm still digesting it. How about SRFI 42? Here's your

Re: New egg: CHICKEN Transducers

2023-01-04 Thread Peter Bex
On Wed, Jan 04, 2023 at 06:48:56PM -0700, Jeremy Steward wrote: > I've been somewhat bothered by the fragmentation in a certain aspect of > Scheme / Lisp: notably that there isn't really something akin to Rust's > Iterator trait in Scheme, and as a result working across various collections > and

Re: New egg: CHICKEN Transducers

2023-01-04 Thread Mario Domenech Goulart
On Wed, 4 Jan 2023 18:48:56 -0700 Jeremy Steward wrote: > I've been somewhat bothered by the fragmentation in a certain aspect > of Scheme / Lisp: notably that there isn't really something akin to > Rust's Iterator trait in Scheme, and as a result working across > various collections and data

New egg: CHICKEN Transducers

2023-01-04 Thread Jeremy Steward
Hey all, I've been somewhat bothered by the fragmentation in a certain aspect of Scheme / Lisp: notably that there isn't really something akin to Rust's Iterator trait in Scheme, and as a result working across various collections and data types is a pain. So I introduce to you -