Re: [Chicken-users] ANN: lazy-seq, a port of Clojure's lazy sequence API

2012-06-03 Thread John Cowan
Peter Danenberg scripsit: Stream-cons, stream-lambda, c. are so fucking verbose! Only two letters longer than lazy-length, lazy-map, lazy-head, lazy-tail, etc. Why not a macro with-lazy that rewrites car, cdr, lambda, cons, etc. within its body? -- Here lies the Christian,

Re: [Chicken-users] ANN: lazy-seq, a port of Clojure's lazy sequence API

2012-06-03 Thread Alex Shinn
On Sun, Jun 3, 2012 at 4:05 PM, John Cowan co...@mercury.ccil.org wrote: Peter Danenberg scripsit: Stream-cons, stream-lambda, c. are so fucking verbose! Only two letters longer than lazy-length, lazy-map, lazy-head, lazy-tail, etc. Why not a macro with-lazy that rewrites car, cdr, lambda,

Re: [Chicken-users] ANN: lazy-seq, a port of Clojure's lazy sequence API

2012-06-03 Thread Peter Danenberg
Quoth Alex Shinn on Prickle-Prickle, the 8th of Confusion: Now, if we have a whole program or library which consistently uses lazy streams instead of lists, we can import srfi-41 renaming all the stream-* bindings by removing the stream- prefix. Interesting idea; the attached program will,

Re: [Chicken-users] ANN: lazy-seq, a port of Clojure's lazy sequence API

2012-06-03 Thread Alex Shinn
On Sun, Jun 3, 2012 at 5:31 PM, Peter Danenberg p...@roxygen.org wrote: Quoth Alex Shinn on Prickle-Prickle, the 8th of Confusion: Now, if we have a whole program or library which consistently uses lazy streams instead of lists, we can import srfi-41 renaming all the stream-* bindings by

Re: [Chicken-users] ANN: lazy-seq, a port of Clojure's lazy sequence API

2012-06-03 Thread Peter Danenberg
Quoth Alex Shinn on Prickle-Prickle, the 8th of Confusion: You mis-matched your parens - it should be: (define (factorial n) (ref (scan * 1 (from 1)) n)) ^^^ Presumably you compiled to get a segfault - the interpreter gives an arity error.

Re: [Chicken-users] ANN: lazy-seq, a port of Clojure's lazy sequence API

2012-06-03 Thread Christian Kellermann
* Peter Danenberg p...@roxygen.org [120603 11:12]: Quoth Alex Shinn on Prickle-Prickle, the 8th of Confusion: You mis-matched your parens - it should be: (define (factorial n) (ref (scan * 1 (from 1)) n)) ^^^ Presumably you compiled to get a

Re: [Chicken-users] ANN: lazy-seq, a port of Clojure's lazy sequence API

2012-06-03 Thread Peter Danenberg
Quoth Christian Kellermann on Prickle-Prickle, the 8th of Confusion: Which version of chicken is this? I get the arity error for both csi and compiled version for chicken master. It's a vanilla 4.7.0: λ ~/prg/scm/aima-chicken/ master* chicken -version (c)2008-2011 The Chicken Team

Re: [Chicken-users] ANN: lazy-seq, a port of Clojure's lazy sequence API

2012-06-03 Thread Christian Kellermann
* Peter Danenberg p...@roxygen.org [120603 11:30]: Quoth Christian Kellermann on Prickle-Prickle, the 8th of Confusion: Which version of chicken is this? I get the arity error for both csi and compiled version for chicken master. It's a vanilla 4.7.0: ?? ~/prg/scm/aima-chicken/ master*

Re: [Chicken-users] ANN: lazy-seq, a port of Clojure's lazy sequence API

2012-06-03 Thread Moritz Heidkamp
Alex Shinn alexsh...@gmail.com writes: First, the srfi-41 vs. lazy-seq comparison in the blog post was an apples to oranges comparison of a clumsy letrec vs a compact named let. If we rewrite the srfi-41 version in the same style as the lazy-seq one, then we get: (define multiples-of-three

Re: [Chicken-users] ANN: lazy-seq, a port of Clojure's lazy sequence API

2012-06-03 Thread John Cowan
Alex Shinn scripsit: Now, if we have a whole program or library which consistently uses lazy streams instead of lists, we can import srfi-41 renaming all the stream-* bindings by removing the stream- prefix (this is where the drop-prefix you like comes in handy). Yes, it allows Scheme to

Re: [Chicken-users] ANN: lazy-seq, a port of Clojure's lazy sequence API

2012-06-03 Thread Alex Shinn
On Sun, Jun 3, 2012 at 8:31 PM, Moritz Heidkamp mor...@twoticketsplease.de wrote: Alex Shinn alexsh...@gmail.com writes: First, the srfi-41 vs. lazy-seq comparison in the blog post was an apples to oranges comparison of a clumsy letrec vs a compact named let.  If we rewrite the srfi-41