given sequences xy and z
(flatten (interleave (partition 1 2 xy) (partition 1 2 (rest xy)) z))
works..
On Thursday, June 27, 2013 11:37:40 AM UTC+1, Paul Meehan wrote:
>
> Hi,
>
> Given a sequence (x1, y1, x2, y2, x3, y3,...)
>
> and another (z1, z2, z3, ...)
>
> I
Hi
Figured it out - Partition first sequence into two sequences then
interleave the three sequences.
Paul
On Thursday, June 27, 2013 11:37:40 AM UTC+1, Paul Meehan wrote:
>
> Hi,
>
> Given a sequence (x1, y1, x2, y2, x3, y3,...)
>
> and another (z1, z2, z3, ...)
>
> I
Hi,
Given a sequence (x1, y1, x2, y2, x3, y3,...)
and another (z1, z2, z3, ...)
I want to interleave such that I get a sequence
(x1, y1, z1, x2, y2, z2, x3, y3, z3, ...)
What's the most succinct way to achieve this?
thanks
Paul
--
--
You received this message because you are subscribed to
Sorry to repoen the discussion, but I got this:
=> (def alist '(1 ~(fn [x y](+ x y
#'user/alist
=> (apply (second alist) '(1 3))
#clojure.lang.Cons cannot be cast to clojure.lang.IFn
(NO_SOURCE_FILE:0)>
On 07/12/2011 23:13, Benny Tsai wrote:
Nice, yes, that works just as well :)
On Tue
Cheers guys - still getting to grips with Clojure, but
getting there.
On 07/12/2011 23:13, Benny Tsai wrote:
Nice, yes, that works just as well :)
On Tuesday, July 12, 2011 4:09:09 PM UTC-6, LaPingvino wrote:
Didn't try, but shoudn't (def alist `(1 ~(fn [x y] (+
x y be better? The
Hi
I was wondering if anyone could shed some light on the
following code:
(def alist '(1 fn [x y](+ x y)))
(apply (second alist) '(1 3))
The result at REPL is 3 i.e. the second element of '(1 3).
Should the result not be 4 i.e. the result of applying the
arguments 1 and 3 to the anonymous fu
Hi
I was wondering if anyone could shed some light on the
following code:
(def alist '(1 fn [x y](+ x y)))
(apply (second alist) '(1 3))
The result at REPL is 3 i.e. the second element of '(1 3).
Should the result not be 4 i.e. the result of applying the
arguments 1 and 3 to the anonymous
Hi
Has anyone tried:
http://www.clojureatlas.com/
Any comments/feedback?
thanks
Paul C. Meehan
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moder