librelist archives

« back to archive

Playing with lazy seqs + cookbook idea

Playing with lazy seqs + cookbook idea

From:
i-blis
Date:
2013-05-18 @ 10:35
Hi all. Thanks for the hangout, it was very nice sharing everyone's enthusiasm.  

As I mentioned during the chat, I like to think about something I could 
easily write in Ruby and then figure out how to do it in Clojure.

Not so long ago (while reading ch. 6), I set on writing a function that 
returns a lazy sequence of a given subreddit's entries. Just to get things
clear, I wrote a quick Ruby implementation and then moved on to doing the 
same in (possibly idiomatic) Clojure. I posted a gist of it: 
https://gist.github.com/i-blis/5522826.

Take a look if you have some time. I would really like to have some 
feedback (even, as many of you are professional Rubyists, on the Ruby 
part). The Clojure magic appears in `lazy-cat` a standard macro that wraps
the usual `(cons (first s) (lazy-seq (rest s))` stuff.

Another thing I am trying to do in the same mood is compiling a kind of 
Clojure cookbook (using the Ruby cookbook as an inspiration from times to 
times) of stuff I know how to easily achieve in Ruby. We could share some 
of these if some are interested (and as soon as my experiments take a 
better shape).

Regards, i-blis. 

Re: [foray] Playing with lazy seqs + cookbook idea

From:
Andrew Wagner
Date:
2013-05-18 @ 11:24
Wow, I think that clojure code is beautifully written; very easy to read,
broken up into nice small pieces. Well-done!

Andrew


On Sat, May 18, 2013 at 6:35 AM, i-blis <i-blis@yandex.ru> wrote:

> Hi all. Thanks for the hangout, it was very nice sharing everyone's
> enthusiasm.
>
> As I mentioned during the chat, I like to think about something I could
> easily write in Ruby and then figure out how to do it in Clojure.
>
> Not so long ago (while reading ch. 6), I set on writing a function that
> returns a lazy sequence of a given subreddit's entries. Just to get things
> clear, I wrote a quick Ruby implementation and then moved on to doing the
> same in (possibly idiomatic) Clojure. I posted a gist of it:
> https://gist.github.com/i-blis/5522826.
>
> Take a look if you have some time. I would really like to have some
> feedback (even, as many of you are professional Rubyists, on the Ruby
> part). The Clojure magic appears in `lazy-cat` a standard macro that wraps
> the usual `(cons (first s) (lazy-seq (rest s))` stuff.
>
> Another thing I am trying to do in the same mood is compiling a kind of
> Clojure cookbook (using the Ruby cookbook as an inspiration from times to
> times) of stuff I know how to easily achieve in Ruby. We could share some
> of these if some are interested (and as soon as my experiments take a
> better shape).
>
> Regards, i-blis.
>
>
>

Re: [foray] Playing with lazy seqs + cookbook idea

From:
i-blis
Date:
2013-05-18 @ 11:50
Thanks, Andrew.

In fact I first thought I was doing things wrong with lazy-sequences. I 
asked on SO, the smart guys there explained why there was nothing wrong…

I'm now slowly getting the lazy-seq vs tail-recursion stuff (which boils 
down to heap vs stack management).

i-  


On Saturday, 18 May 2013 at 13:24, Andrew Wagner wrote:

> Wow, I think that clojure code is beautifully written; very easy to 
read, broken up into nice small pieces. Well-done!
>  
> Andrew
>  
>  
> On Sat, May 18, 2013 at 6:35 AM, i-blis <i-blis@yandex.ru 
(mailto:i-blis@yandex.ru)> wrote:
> > Hi all. Thanks for the hangout, it was very nice sharing everyone's 
enthusiasm.
> >  
> > As I mentioned during the chat, I like to think about something I 
could easily write in Ruby and then figure out how to do it in Clojure.
> >  
> > Not so long ago (while reading ch. 6), I set on writing a function 
that returns a lazy sequence of a given subreddit's entries. Just to get 
things clear, I wrote a quick Ruby implementation and then moved on to 
doing the same in (possibly idiomatic) Clojure. I posted a gist of it: 
https://gist.github.com/i-blis/5522826.
> >  
> > Take a look if you have some time. I would really like to have some 
feedback (even, as many of you are professional Rubyists, on the Ruby 
part). The Clojure magic appears in `lazy-cat` a standard macro that wraps
the usual `(cons (first s) (lazy-seq (rest s))` stuff.
> >  
> > Another thing I am trying to do in the same mood is compiling a kind 
of Clojure cookbook (using the Ruby cookbook as an inspiration from times 
to times) of stuff I know how to easily achieve in Ruby. We could share 
some of these if some are interested (and as soon as my experiments take a
better shape).
> >  
> > Regards, i-blis.  

Re: [foray] Playing with lazy seqs + cookbook idea

From:
Ali Baitam
Date:
2013-05-18 @ 16:52
Very nice piece of code indeed. I also like the idea of the Clojure
Cookbook; this would be easy for people still dabbling with 4Clojure
questions to participate while the NLP project would be suitable for people
who are ahead with their skills.

Is this the book <http://www.crummy.com/writing/RubyCookbook/> you are
referring to?


On Sat, May 18, 2013 at 7:50 AM, i-blis <i-blis@yandex.ru> wrote:

> Thanks, Andrew.
>
> In fact I first thought I was doing things wrong with lazy-sequences. I
> asked on SO, the smart guys there explained why there was nothing wrong…
>
> I'm now slowly getting the lazy-seq vs tail-recursion stuff (which boils
> down to heap vs stack management).
>
> i-
>
>
> On Saturday, 18 May 2013 at 13:24, Andrew Wagner wrote:
>
> > Wow, I think that clojure code is beautifully written; very easy to
> read, broken up into nice small pieces. Well-done!
> >
> > Andrew
> >
> >
> > On Sat, May 18, 2013 at 6:35 AM, i-blis <i-blis@yandex.ru (mailto:
> i-blis@yandex.ru)> wrote:
> > > Hi all. Thanks for the hangout, it was very nice sharing everyone's
> enthusiasm.
> > >
> > > As I mentioned during the chat, I like to think about something I
> could easily write in Ruby and then figure out how to do it in Clojure.
> > >
> > > Not so long ago (while reading ch. 6), I set on writing a function
> that returns a lazy sequence of a given subreddit's entries. Just to get
> things clear, I wrote a quick Ruby implementation and then moved on to
> doing the same in (possibly idiomatic) Clojure. I posted a gist of it:
> https://gist.github.com/i-blis/5522826.
> > >
> > > Take a look if you have some time. I would really like to have some
> feedback (even, as many of you are professional Rubyists, on the Ruby
> part). The Clojure magic appears in `lazy-cat` a standard macro that wraps
> the usual `(cons (first s) (lazy-seq (rest s))` stuff.
> > >
> > > Another thing I am trying to do in the same mood is compiling a kind
> of Clojure cookbook (using the Ruby cookbook as an inspiration from times
> to times) of stuff I know how to easily achieve in Ruby. We could share
> some of these if some are interested (and as soon as my experiments take a
> better shape).
> > >
> > > Regards, i-blis.
>
>
>

Re: [foray] Playing with lazy seqs + cookbook idea

From:
i-blis
Date:
2013-05-18 @ 19:27
Thanks again, Ali.

Regarding the cookbook, I've already jotted down a couple of recipes as I 
go on discovering things. I'd be happy to share them as soon as I'd 
cleaned them up, if you and others are interested.  

The idea was to set up a simple git based platform for viewing and 
contributing. I would have like to do it with Compojure but I am not there
yet. May be I'll try something hosted on github, with static pages 
generated with nanoc gem for the recipes. If there is interest, I'll try 
to figure out something next week.

And yes, the Ruby Cookbook is the one by O'reilly (I didn't know the code 
was online, thanks).  


On Saturday, 18 May 2013 at 18:52, Ali Baitam wrote:

> Very nice piece of code indeed. I also like the idea of the Clojure 
Cookbook; this would be easy for people still dabbling with 4Clojure 
questions to participate while the NLP project would be suitable for 
people who are ahead with their skills.
>  
> Is this the book (http://www.crummy.com/writing/RubyCookbook/) you are 
referring to?
>  
>  
> On Sat, May 18, 2013 at 7:50 AM, i-blis <i-blis@yandex.ru 
(mailto:i-blis@yandex.ru)> wrote:
> > Thanks, Andrew.
> >  
> > In fact I first thought I was doing things wrong with lazy-sequences. 
I asked on SO, the smart guys there explained why there was nothing wrong…
> >  
> > I'm now slowly getting the lazy-seq vs tail-recursion stuff (which 
boils down to heap vs stack management).
> >  
> > i-
> >  
> >  
> > On Saturday, 18 May 2013 at 13:24, Andrew Wagner wrote:
> >  
> > > Wow, I think that clojure code is beautifully written; very easy to 
read, broken up into nice small pieces. Well-done!
> > >  
> > > Andrew
> > >  
> > >  
> > > On Sat, May 18, 2013 at 6:35 AM, i-blis <i-blis@yandex.ru 
(mailto:i-blis@yandex.ru) (mailto:i-blis@yandex.ru)> wrote:
> > > > Hi all. Thanks for the hangout, it was very nice sharing 
everyone's enthusiasm.
> > > >  
> > > > As I mentioned during the chat, I like to think about something I 
could easily write in Ruby and then figure out how to do it in Clojure.
> > > >  
> > > > Not so long ago (while reading ch. 6), I set on writing a function
that returns a lazy sequence of a given subreddit's entries. Just to get 
things clear, I wrote a quick Ruby implementation and then moved on to 
doing the same in (possibly idiomatic) Clojure. I posted a gist of it: 
https://gist.github.com/i-blis/5522826.
> > > >  
> > > > Take a look if you have some time. I would really like to have 
some feedback (even, as many of you are professional Rubyists, on the Ruby
part). The Clojure magic appears in `lazy-cat` a standard macro that wraps
the usual `(cons (first s) (lazy-seq (rest s))` stuff.
> > > >  
> > > > Another thing I am trying to do in the same mood is compiling a 
kind of Clojure cookbook (using the Ruby cookbook as an inspiration from 
times to times) of stuff I know how to easily achieve in Ruby. We could 
share some of these if some are interested (and as soon as my experiments 
take a better shape).
> > > >  
> > > > Regards, i-blis.  

Re: [foray] Playing with lazy seqs + cookbook idea

From:
Ali Baitam
Date:
2013-05-18 @ 20:38
Yes, I am interested in it so that I can compare what I do with what you
did. There is no need for a website; I think sharing a repo is more than
enough.

I am personally not attempting any projects at this stage. There are lots
of functions and concepts in Clojure that I need to internalize before I
tackle projects. These snippets would be helpful. I solved around 30 of the
4Clojure problems and I find the solutions of others useful. Your solutions
to the cookbook recipes would be useful and practical as well.


On Sat, May 18, 2013 at 3:27 PM, i-blis <i-blis@yandex.ru> wrote:

> Thanks again, Ali.
>
> Regarding the cookbook, I've already jotted down a couple of recipes as I
> go on discovering things. I'd be happy to share them as soon as I'd cleaned
> them up, if you and others are interested.
>
> The idea was to set up a simple git based platform for viewing and
> contributing. I would have like to do it with Compojure but I am not there
> yet. May be I'll try something hosted on github, with static pages
> generated with nanoc gem for the recipes. If there is interest, I'll try to
> figure out something next week.
>
> And yes, the Ruby Cookbook is the one by O'reilly (I didn't know the code
> was online, thanks).
>
>
> On Saturday, 18 May 2013 at 18:52, Ali Baitam wrote:
>
> > Very nice piece of code indeed. I also like the idea of the Clojure
> Cookbook; this would be easy for people still dabbling with 4Clojure
> questions to participate while the NLP project would be suitable for people
> who are ahead with their skills.
> >
> > Is this the book (http://www.crummy.com/writing/RubyCookbook/) you are
> referring to?
> >
> >
> > On Sat, May 18, 2013 at 7:50 AM, i-blis <i-blis@yandex.ru (mailto:
> i-blis@yandex.ru)> wrote:
> > > Thanks, Andrew.
> > >
> > > In fact I first thought I was doing things wrong with lazy-sequences.
> I asked on SO, the smart guys there explained why there was nothing wrong…
> > >
> > > I'm now slowly getting the lazy-seq vs tail-recursion stuff (which
> boils down to heap vs stack management).
> > >
> > > i-
> > >
> > >
> > > On Saturday, 18 May 2013 at 13:24, Andrew Wagner wrote:
> > >
> > > > Wow, I think that clojure code is beautifully written; very easy to
> read, broken up into nice small pieces. Well-done!
> > > >
> > > > Andrew
> > > >
> > > >
> > > > On Sat, May 18, 2013 at 6:35 AM, i-blis <i-blis@yandex.ru (mailto:
> i-blis@yandex.ru) (mailto:i-blis@yandex.ru)> wrote:
> > > > > Hi all. Thanks for the hangout, it was very nice sharing
> everyone's enthusiasm.
> > > > >
> > > > > As I mentioned during the chat, I like to think about something I
> could easily write in Ruby and then figure out how to do it in Clojure.
> > > > >
> > > > > Not so long ago (while reading ch. 6), I set on writing a function
> that returns a lazy sequence of a given subreddit's entries. Just to get
> things clear, I wrote a quick Ruby implementation and then moved on to
> doing the same in (possibly idiomatic) Clojure. I posted a gist of it:
> https://gist.github.com/i-blis/5522826.
> > > > >
> > > > > Take a look if you have some time. I would really like to have
> some feedback (even, as many of you are professional Rubyists, on the Ruby
> part). The Clojure magic appears in `lazy-cat` a standard macro that wraps
> the usual `(cons (first s) (lazy-seq (rest s))` stuff.
> > > > >
> > > > > Another thing I am trying to do in the same mood is compiling a
> kind of Clojure cookbook (using the Ruby cookbook as an inspiration from
> times to times) of stuff I know how to easily achieve in Ruby. We could
> share some of these if some are interested (and as soon as my experiments
> take a better shape).
> > > > >
> > > > > Regards, i-blis.
>
>
>

Re: [foray] Playing with lazy seqs + cookbook idea

From:
i-blis
Date:
2013-05-18 @ 20:55
Ok, I'll make gists or a github repo, as soon as I'd clean up a couple of 
my "recipes".


On Saturday, 18 May 2013 at 22:38, Ali Baitam wrote:

> Yes, I am interested in it so that I can compare what I do with what you
did. There is no need for a website; I think sharing a repo is more than 
enough.
>  
> I am personally not attempting any projects at this stage. There are 
lots of functions and concepts in Clojure that I need to internalize 
before I tackle projects. These snippets would be helpful. I solved around
30 of the 4Clojure problems and I find the solutions of others useful. 
Your solutions to the cookbook recipes would be useful and practical as 
well.  
>  
>  
> On Sat, May 18, 2013 at 3:27 PM, i-blis <i-blis@yandex.ru 
(mailto:i-blis@yandex.ru)> wrote:
> > Thanks again, Ali.
> >  
> > Regarding the cookbook, I've already jotted down a couple of recipes 
as I go on discovering things. I'd be happy to share them as soon as I'd 
cleaned them up, if you and others are interested.
> >  
> > The idea was to set up a simple git based platform for viewing and 
contributing. I would have like to do it with Compojure but I am not there
yet. May be I'll try something hosted on github, with static pages 
generated with nanoc gem for the recipes. If there is interest, I'll try 
to figure out something next week.
> >  
> > And yes, the Ruby Cookbook is the one by O'reilly (I didn't know the 
code was online, thanks).
> >  
> >  
> > On Saturday, 18 May 2013 at 18:52, Ali Baitam wrote:
> >  
> > > Very nice piece of code indeed. I also like the idea of the Clojure 
Cookbook; this would be easy for people still dabbling with 4Clojure 
questions to participate while the NLP project would be suitable for 
people who are ahead with their skills.
> > >  
> > > Is this the book (http://www.crummy.com/writing/RubyCookbook/) you 
are referring to?
> > >  
> > >  
> > > On Sat, May 18, 2013 at 7:50 AM, i-blis <i-blis@yandex.ru 
(mailto:i-blis@yandex.ru) (mailto:i-blis@yandex.ru)> wrote:
> > > > Thanks, Andrew.
> > > >  
> > > > In fact I first thought I was doing things wrong with 
lazy-sequences. I asked on SO, the smart guys there explained why there 
was nothing wrong…
> > > >  
> > > > I'm now slowly getting the lazy-seq vs tail-recursion stuff (which
boils down to heap vs stack management).
> > > >  
> > > > i-
> > > >  
> > > >  
> > > > On Saturday, 18 May 2013 at 13:24, Andrew Wagner wrote:
> > > >  
> > > > > Wow, I think that clojure code is beautifully written; very easy
to read, broken up into nice small pieces. Well-done!
> > > > >  
> > > > > Andrew
> > > > >  
> > > > >  
> > > > > On Sat, May 18, 2013 at 6:35 AM, i-blis <i-blis@yandex.ru 
(mailto:i-blis@yandex.ru) (mailto:i-blis@yandex.ru) 
(mailto:i-blis@yandex.ru)> wrote:
> > > > > > Hi all. Thanks for the hangout, it was very nice sharing 
everyone's enthusiasm.
> > > > > >  
> > > > > > As I mentioned during the chat, I like to think about 
something I could easily write in Ruby and then figure out how to do it in
Clojure.
> > > > > >  
> > > > > > Not so long ago (while reading ch. 6), I set on writing a 
function that returns a lazy sequence of a given subreddit's entries. Just
to get things clear, I wrote a quick Ruby implementation and then moved on
to doing the same in (possibly idiomatic) Clojure. I posted a gist of it: 
https://gist.github.com/i-blis/5522826.
> > > > > >  
> > > > > > Take a look if you have some time. I would really like to have
some feedback (even, as many of you are professional Rubyists, on the Ruby
part). The Clojure magic appears in `lazy-cat` a standard macro that wraps
the usual `(cons (first s) (lazy-seq (rest s))` stuff.
> > > > > >  
> > > > > > Another thing I am trying to do in the same mood is compiling 
a kind of Clojure cookbook (using the Ruby cookbook as an inspiration from
times to times) of stuff I know how to easily achieve in Ruby. We could 
share some of these if some are interested (and as soon as my experiments 
take a better shape).
> > > > > >  
> > > > > > Regards, i-blis.  

Re: [foray] Playing with lazy seqs + cookbook idea

From:
Ricardo Mendes
Date:
2013-05-18 @ 21:36
I would also suggest using the wiki pages on github (which are Git repos
themselves) as a way of sharing things like small tutorials or recipes

On Saturday, May 18, 2013, i-blis wrote:

> Ok, I'll make gists or a github repo, as soon as I'd clean up a couple of
> my "recipes".
>
>
> On Saturday, 18 May 2013 at 22:38, Ali Baitam wrote:
>
> > Yes, I am interested in it so that I can compare what I do with what you
> did. There is no need for a website; I think sharing a repo is more than
> enough.
> >
> > I am personally not attempting any projects at this stage. There are
> lots of functions and concepts in Clojure that I need to internalize before
> I tackle projects. These snippets would be helpful. I solved around 30 of
> the 4Clojure problems and I find the solutions of others useful. Your
> solutions to the cookbook recipes would be useful and practical as well.
> >
> >
> > On Sat, May 18, 2013 at 3:27 PM, i-blis <i-blis@yandex.ru 
<javascript:;>(mailto:
> i-blis@yandex.ru <javascript:;>)> wrote:
> > > Thanks again, Ali.
> > >
> > > Regarding the cookbook, I've already jotted down a couple of recipes
> as I go on discovering things. I'd be happy to share them as soon as I'd
> cleaned them up, if you and others are interested.
> > >
> > > The idea was to set up a simple git based platform for viewing and
> contributing. I would have like to do it with Compojure but I am not there
> yet. May be I'll try something hosted on github, with static pages
> generated with nanoc gem for the recipes. If there is interest, I'll try to
> figure out something next week.
> > >
> > > And yes, the Ruby Cookbook is the one by O'reilly (I didn't know the
> code was online, thanks).
> > >
> > >
> > > On Saturday, 18 May 2013 at 18:52, Ali Baitam wrote:
> > >
> > > > Very nice piece of code indeed. I also like the idea of the Clojure
> Cookbook; this would be easy for people still dabbling with 4Clojure
> questions to participate while the NLP project would be suitable for people
> who are ahead with their skills.
> > > >
> > > > Is this the book (http://www.crummy.com/writing/RubyCookbook/) you
> are referring to?
> > > >
> > > >
> > > > On Sat, May 18, 2013 at 7:50 AM, i-blis 
<i-blis@yandex.ru<javascript:;>(mailto:
> i-blis@yandex.ru <javascript:;>) (mailto:i-blis@yandex.ru <javascript:;>)>
> wrote:
> > > > > Thanks, Andrew.
> > > > >
> > > > > In fact I first thought I was doing things wrong with
> lazy-sequences. I asked on SO, the smart guys there explained why there was
> nothing wrong…
> > > > >
> > > > > I'm now slowly getting the lazy-seq vs tail-recursion stuff (which
> boils down to heap vs stack management).
> > > > >
> > > > > i-
> > > > >
> > > > >
> > > > > On Saturday, 18 May 2013 at 13:24, Andrew Wagner wrote:
> > > > >
> > > > > > Wow, I think that clojure code is beautifully written; very easy
> to read, broken up into nice small pieces. Well-done!
> > > > > >
> > > > > > Andrew
> > > > > >
> > > > > >
> > > > > > On Sat, May 18, 2013 at 6:35 AM, i-blis 
<i-blis@yandex.ru<javascript:;>(mailto:
> i-blis@yandex.ru <javascript:;>) (mailto:i-blis@yandex.ru <javascript:;>)
> (mailto:i-blis@yandex.ru <javascript:;>)> wrote:
> > > > > > > Hi all. Thanks for the hangout, it was very nice sharing
> everyone's enthusiasm.
> > > > > > >
> > > > > > > As I mentioned during the chat, I like to think about
> something I could easily write in Ruby and then figure out how to do it in
> Clojure.
> > > > > > >
> > > > > > > Not so long ago (while reading ch. 6), I set on writing a
> function that returns a lazy sequence of a given subreddit's entries. Just
> to get things clear, I wrote a quick Ruby implementation and then moved on
> to doing the same in (possibly idiomatic) Clojure. I posted a gist of it:
> https://gist.github.com/i-blis/5522826.
> > > > > > >
> > > > > > > Take a look if you have some time. I would really like to have
> some feedback (even, as many of you are professional Rubyists, on the Ruby
> part). The Clojure magic appears in `lazy-cat` a standard macro that wraps
> the usual `(cons (first s) (lazy-seq (rest s))` stuff.
> > > > > > >
> > > > > > > Another thing I am trying to do in the same mood is compiling
> a kind of Clojure cookbook (using the Ruby cookbook as an inspiration from
> times to times) of stuff I know how to easily achieve in Ruby. We could
> share some of these if some are interested (and as soon as my experiments
> take a better shape).
> > > > > > >
> > > > > > > Regards, i-blis.
>
>
>