Re: [racket-users] Re: Help with generators from python land!

2019-02-25 Thread Konrad Hinsen
On 23/02/2019 14:25, Zelphir Kaltstahl wrote: The main difference, as has been pointed out before, is that Python generators are more common as an idiom for solving problems that in Racket would typically be approached differently. This piqued my interest. Can you elaborate a bit or give an

Re: [racket-users] Re: Help with generators from python land!

2019-02-23 Thread Matthias Felleisen
> I imagine some input, that is too big and should be handled one element > at a time instead. How would one do that in Racket, when not using > something comparable to a Python generator? It depends on the situation specifically the interface that’s force on your components (if any) and how

Re: [racket-users] Re: Help with generators from python land!

2019-02-23 Thread Greg Hendershott
I have zero mileage with Python generators and I don't teach CS. But my understanding is: Sometimes you have a problem where it is nicer to express the solution as two independent pieces: a producer and a consumer that run concurrently. ("Concurrently" doesn't necessarily mean actually in

Re: [racket-users] Re: Help with generators from python land!

2019-02-23 Thread Dave McDaniel
I was wondering the same, thought maybe `for` or `for-each` on an input stream since those dont accumulate into a data structure? On Sat, Feb 23, 2019, 8:25 AM Zelphir Kaltstahl wrote: > > The main difference, as has been pointed out before, is that Python > generators are more common as an

[racket-users] Re: Help with generators from python land!

2019-02-23 Thread Zelphir Kaltstahl
> The main difference, as has been pointed out before, is that Python generators are more common as an idiom for solving problems that in Racket would typically be approached differently. This piqued my interest. Can you elaborate a bit or give an example? How would one approach things with