Re: Lazy Flatten; One seq at a Time

2017-11-24 Thread Ray Miller
(map (fn [x] + x (rand-int 10)) (range 4) > (apply concat) > (take 1)) > New seq... > => (3) > ``` > > Lazy-flatten is unnecessary because concat already does what you want – > the generalised problem you're running in to is that function argument

Re: Lazy Flatten; One seq at a Time

2017-11-22 Thread Stephen Nelson
``` (->> (repeatedly (fn [] (lazy-seq (println "New seq...") (map (fn [x] + x (rand-int 10)) (range 4) (apply concat) (take 1)) New seq... => (3) ``` Lazy-flatten is unnecessary because concat already does what you want – the

Re: Lazy Flatten; One seq at a Time

2017-11-22 Thread Matt Anderson
at-seq [0 1 2 3 4 10 11 12 13 14 20 21 22 23 24])) > > > Alan > > > On Tue, Nov 21, 2017 at 4:47 PM, Jason Wolfe > wrote: > >> I think this >> <https://github.com/plumatic/plumbing/blob/318af7798bb701607aaae8639d12829014941184/src/plumbing/core.cl

Re: Lazy Flatten; One seq at a Time

2017-11-21 Thread Alan Thompson
: > I think this > <https://github.com/plumatic/plumbing/blob/318af7798bb701607aaae8639d12829014941184/src/plumbing/core.cljx#L182> > will do it: > > (lazy-cat (first coll) (when-let [n (next coll)] (lazy-flatten n > > > On Tuesday, November 21, 2017 at 2:34:15 PM

Re: Lazy Flatten; One seq at a Time

2017-11-21 Thread Jason Wolfe
I think this <https://github.com/plumatic/plumbing/blob/318af7798bb701607aaae8639d12829014941184/src/plumbing/core.cljx#L182> will do it: (lazy-cat (first coll) (when-let [n (next coll)] (lazy-flatten n On Tuesday, November 21, 2017 at 2:34:15 PM UTC-8, Matt Anderson wrote: > &

Lazy Flatten; One seq at a Time

2017-11-21 Thread Matt Anderson
" 2 "top level" seqs at a time and I'm afraid that may be the best I get, but I thought it might be an exercise worth presenting in case anyone had ideas. Here's a contrived example: (defn lazy-flatten [coll] (when-let [s (seq coll)] (lazy-seq (if (seq? (

Re: (flatten non-sequential) has a surprising result

2015-07-02 Thread J . Pablo Fernández
Yes, reading the source code and trying to understand why rest was being called there is how I came up with this case. On 2 July 2015 at 07:54, icamts wrote: > Hi Pablo, > I think you're right. Have a look at flatten source > > (defn flatten > "Takes any nested

Re: (flatten non-sequential) has a surprising result

2015-07-01 Thread icamts
Hi Pablo, I think you're right. Have a look at flatten source (defn flatten "Takes any nested combination of sequential things (lists, vectors, etc.) and returns their contents as a single, flat sequence. (flatten nil) returns an empty sequence." {:added "1.2&qu

Re: (flatten non-sequential) has a surprising result

2015-07-01 Thread J . Pablo Fernández
C+1, J. Pablo Fernández wrote: >> >> Hello Clojurists, >> >> Today I was surprised by the result of (flatten 1) which is '(). I was >> expecting '(1) or an error. Talking in some other people in #clojure @ >> clojurians.net, not everybody agrees that '(1) i

Re: (flatten non-sequential) has a surprising result

2015-07-01 Thread Mikera
On Wednesday, 1 July 2015 12:55:28 UTC+1, J. Pablo Fernández wrote: > > Hello Clojurists, > > Today I was surprised by the result of (flatten 1) which is '(). I was > expecting '(1) or an error. Talking in some other people in #clojure @ > clojurians.net, not everybod

(flatten non-sequential) has a surprising result

2015-07-01 Thread J . Pablo Fernández
Hello Clojurists, Today I was surprised by the result of (flatten 1) which is '(). I was expecting '(1) or an error. Talking in some other people in #clojure @ clojurians.net, not everybody agrees that '(1) is a good result but that '() is somewhat surprising. Would it be

Re: Critiques of "my-flatten" which uses CPS

2014-07-18 Thread Mark Phillips
Thanks - useful idioms to know about! On Friday, 18 July 2014 16:18:33 UTC+9:30, puzzler wrote: > > Yeah, you've answered your own question. In practice, I doubt the > difference is measurable. > > Another common idiom you see in Clojure code is: > (defn f [xs] > (if-let [s (seq xs)] > ...

Re: Critiques of "my-flatten" which uses CPS

2014-07-17 Thread Mark Engelberg
Yeah, you've answered your own question. In practice, I doubt the difference is measurable. Another common idiom you see in Clojure code is: (defn f [xs] (if-let [s (seq xs)] ...do something with (first s) and (f (rest s))... ...base case...)) This ensures that you seq-ify the input (r

Re: Critiques of "my-flatten" which uses CPS

2014-07-17 Thread Mark Phillips
I *think* I've found the answer to my own question... In this post... https://groups.google.com/forum/#!topic/clojure/Cuk_bJrIq-Y I found this link (I changed the line number)... https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L2589 And if the implementat

Re: Critiques of "my-flatten" which uses CPS

2014-07-17 Thread Mark Phillips
Thanks again - that all makes sense. One (hopefully) tiny question... an efficiency one... (and feel free not to answer it if I've already taken up enough of your time) If you do that and are careful, the performance of next/nil? is slightly > better than rest/empty?. > If I use the next/nil?

Re: Critiques of "my-flatten" which uses CPS

2014-07-17 Thread Mark Engelberg
On Thu, Jul 17, 2014 at 7:54 PM, Mark P wrote: > > I notice in your lazy version (below), you preface the last cons with a > lazy-seq call, but do not do the same with the other cons calls (within the > first recur form). I know it was only the last line that previously had a > conj call and so

Re: Critiques of "my-flatten" which uses CPS

2014-07-17 Thread Mark P
verflow in the realization of that lazy flattened list: > Why does going lazy avoid a stack overflow risk? Again, to answer my own question :-) ... The resultant flat list from my-flatten will be realized one element at a time. The call stack will be used during this process, but lazy-seq pr

Re: Critiques of "my-flatten" which uses CPS

2014-07-17 Thread Mark P
Woopse, typo towards the end of my last post... Maybe the thing to do would be to use (next x) here for this > implementation, which is angling to be lazy... But in your earlier > acc-based my-flatten, to use (next x) instead > Should be... Maybe the thing to do would be to us

Re: Critiques of "my-flatten" which uses CPS

2014-07-17 Thread Mark P
e last line is to defer the recursive call to my-flatten until something wants to use it. In contrast, the other cons-involving line only conses up things which are relatively harmless to evaluate. 2. The "cons (first x) ..." will be "undone" almost immediately after t

Re: Critiques of "my-flatten" which uses CPS

2014-07-17 Thread Raoul Duke
> http://clojure.org/reducers i dare say the "When to use" part should not be at the bottom but come right after the otherwise laughably specious "yielding code that will get faster automatically as machines get more cores". -- You received this message because you are subscribed to the Google G

Re: Critiques of "my-flatten" which uses CPS

2014-07-17 Thread Steve Miner
Slightly off-topic from original poster's question, but if you're interested in another implementation of flatten, I suggest you take a look at the reducers library. clojure.core/flatten is elegant but a bit slow. The reducers version is very fast as part of a reduce/fold opera

Re: Critiques of "my-flatten" which uses CPS

2014-07-17 Thread Mark Engelberg
he input as > you go to achieve the desired result. > > I've come up with another version, that passes through both a "result so > far" accumulator and a "still to be computed" stack. It is very much > non-lazy, but that's okay in some applicatio

Re: Critiques of "my-flatten" which uses CPS

2014-07-16 Thread Mark P
through both a "result so far" accumulator and a "still to be computed" stack. It is very much non-lazy, but that's okay in some applications (a performance feature even!). Here it is... (defn my-accandstackbased-flatten [xs] (letfn [(flatten-accandstack [xs acc

Re: Critiques of "my-flatten" which uses CPS

2014-07-15 Thread Mark Engelberg
It's worth understanding how to go back and forth between accumulator-style and a lazy construction. You can convert the above non-lazy accumulator version into a similar version that is lazy but has no risk of stack overflow in the realization of that lazy flattened list: (defn my-flatten

Re: Critiques of "my-flatten" which uses CPS

2014-07-15 Thread Mark Engelberg
To avoid the doall-concat, you'd just have the base case return [] (btw, you don't need the apostrophe for vectors or for the empty list), and use `into` rather than `concat`. If you're looking for something that exploits the structure of flatten and uses an accumulator, you could

Re: Critiques of "my-flatten" which uses CPS

2014-07-15 Thread Mark P
. It is better to use a strict version of the something in the first place. Does Clojure provide strict versions of things like concat, or would I need to roll-my-own? Thinking again of efficiency... I had a go at doing an accumulator-passing-style (APS) version of flatten. Here it is... (defn

Re: Critiques of "my-flatten" which uses CPS

2014-07-15 Thread Jonathan Fischer Friberg
nd as part of the > learning process I've done a CPS version of a "flatten" function. Ie, it > does the same thing as the standard clojure "flatten", but is implemented > using a recursive local CPS helper function. I'm interested in comments / > crit

Re: Critiques of "my-flatten" which uses CPS

2014-07-15 Thread Mark Engelberg
Yes, here's the trampolined version which won't stack overflow: (defn my-flatten [xs] (letfn [(my-flatten-cps [xs k] (if (nil? xs) (k '()) (let [x (first xs), ys (next xs)] (if (sequential? x) (recur

Critiques of "my-flatten" which uses CPS

2014-07-15 Thread Mark P
I'm very new to continuation passing style (CPS), and as part of the learning process I've done a CPS version of a "flatten" function. Ie, it does the same thing as the standard clojure "flatten", but is implemented using a recursive local CPS helper functio

Re: another why: (flatten #{:a :b}) => () ???

2012-08-29 Thread dmirylenka
Thanks for the elaborate answer! It also clears some other doubts I had regarding the core functions. On Wednesday, August 29, 2012 11:34:56 PM UTC+2, miner wrote: > > flatten has been discussed before: > > https://groups.google.com/forum/?fromgroups=#!topic/clojure/ye70iNJ73zc >

Re: another why: (flatten #{:a :b}) => () ???

2012-08-29 Thread Steve Miner
flatten has been discussed before: https://groups.google.com/forum/?fromgroups=#!topic/clojure/ye70iNJ73zc See also CLJ-400, but it looks like no patch was submitted. http://dev.clojure.org/jira/browse/CLJ-400 I think the general policy for Clojure is that the core functions of course should

another why: (flatten #{:a :b}) => () ???

2012-08-29 Thread dmirylenka
Calling flatten on anything that is not 'sequential?' returns an empty sequence: (flatten 1); => () (flatten "Hi"); => () With sets if feels somewhat strange: (flatten #{#{:a} #{:b :c}}); => () For some reason I expected #{#{:a} #{:b :c}} to equal #{:a :b

Re: How to flatten a nested sequence?

2011-10-04 Thread Sean Corfield
On Tue, Oct 4, 2011 at 2:25 PM, Shoeb Bhinderwala wrote: > Thanks. Didn't think it would exist in clojure.core. I highly recommend trying out Chas Emerick's Clojure Atlas: http://clojureatlas.com - it makes searching for functions AND concepts really easy and provides a great way to see the relat

Re: How to flatten a nested sequence?

2011-10-04 Thread Shoeb Bhinderwala
ot; "s8"]) "s9"])])) > #'sandbox/s1 > sandbox> s1 > ("s1" ("s2" "s3") "s4" "s5" ("s6" ("s7" "s8") "s9")) > sandbox> (flatten s1) > ("s1" "s2"

Re: How to flatten a nested sequence?

2011-10-04 Thread Ulises
your subject contains the answer :) sandbox> (def s1 (seq ["s1" (seq ["s2" "s3"]) "s4" "s5" (seq ["s6" (seq ["s7" "s8"]) "s9"])])) #'sandbox/s1 sandbox> s1 ("s1" ("s2" &q

Re: How to flatten a nested sequence?

2011-10-04 Thread Michał Marczyk
user=> (flatten s1) ("s1" "s2" "s3" "s4" "s5" "s6" "s7" "s8" "s9") Sincerely, Michał -- You received this message because you are subscribed to the Google Groups "Clojure" group. To po

Re: How to flatten a nested sequence?

2011-10-04 Thread Jack Moffitt
> user => s1 > ("s1" ("s2" "s3") "s4" "s5" ("s6" ("s7" "s8") "s9")) > > How to convert s1 to a flat sequence like this: > > ("s1" "s2" "s3" "s4" &q

How to flatten a nested sequence?

2011-10-04 Thread Shoeb Bhinderwala
(def s1 (seq ["s1" (seq ["s2" "s3"]) "s4" "s5" (seq ["s6" (seq ["s7" "s8"]) "s9"])])) user => s1 ("s1" ("s2" "s3") "s4" "s5" ("s6" ("s7" "s8") "s9")) How to convert s1 to a flat sequence like this: ("s1" "s2" "s3" "s4" "s5" "s6" "s7" "s8" "s9") -- You received this message because

Re: (flatten )

2011-09-30 Thread Tassilo Horn
ChrisR writes: > Hi there, possibly the flatten documentation is wrong as (flatten nil) > for me is returning the empty list rather than nil. (1.3.0). Indeed, that's because it uses `filter' which produces a lazy seq. Most probably, in this case it's just the docstring

(flatten )

2011-09-29 Thread ChrisR
Hi there, possibly the flatten documentation is wrong as (flatten nil) for me is returning the empty list rather than nil. (1.3.0). Is there a better place to post this? (clojure.core/flatten nil) => () from docstring: "Takes any nested combination of sequential things (lists, vect

Re: faster flatten?

2010-07-15 Thread Cam
You're right about rest, I didn't see that rest should be preferred to next when consuming seqs in this style. I agree that flatten returning the empty list for some of the things that actually can be "seqed" is odd. I'm sure there's a good reason somewhere, but it&#

Re: faster flatten?

2010-07-14 Thread Steve Miner
On Jul 14, 2010, at 2:40 PM, Cam wrote: > I definitely like this version a little better. If you change the else > of the if to be just (list), it returns the empty list just as core/ > flatten does. Mind if I update the ticket with this patch? It's all yours. Really, just a slig

Re: faster flatten?

2010-07-14 Thread Cam
I definitely like this version a little better. If you change the else of the if to be just (list), it returns the empty list just as core/ flatten does. Mind if I update the ticket with this patch? On Jul 14, 1:56 pm, miner wrote: > I think it's worthwhile to have a faster flatten ev

Re: faster flatten?

2010-07-14 Thread miner
I think it's worthwhile to have a faster flatten even if it doesn't look as elegant as the current implementation. You could do a bit of refactoring and save yourself a call to sequential? since the recursive calls are guaranteed to have seqs (as a result of next). Also, I'd pr

Re: faster flatten?

2010-07-13 Thread Cam
OK, all submitted. The tickets are up for discussion at http://www.assembla.com/spaces/clojure/support/tickets/400-a-faster-flatten http://www.assembla.com/spaces/clojure/support/tickets/401-promote--seqable---from-contrib- I will mail my CA in tomorrow morning. Thanks Stu and Mark! On Jul 13

Re: faster flatten?

2010-07-13 Thread Stuart Halloway
Hi Cam, Please submit the modified version, and, if you want, create a separate ticket for "seqable?". I would like to review the latter separately. Stu > Hi again, I modified my-flatten to return the empty list for sets and > maps as core/flatten does. It doesn't seem to

Re: faster flatten?

2010-07-13 Thread Cam
Hi again, I modified my-flatten to return the empty list for sets and maps as core/flatten does. It doesn't seem to handle Arrays anymore though. I'm assuming it's because ArrayList and (int-array ...) don't implement Sequential. None the less should I still submit this m

Re: faster flatten?

2010-07-13 Thread Stuart Halloway
Hi Cam, >> >> Your tests aren't testing the interesting part without a doall. >> >> That said, my quick tests with doall show your approach faring even better. >> :-) Also, I think what my-flatten does with Java arrays is intuitive (and >> the curren

Re: faster flatten?

2010-07-13 Thread Cam
he interesting part without a doall. > > That said, my quick tests with doall show your approach faring even better. > :-) Also, I think what my-flatten does with Java arrays is intuitive (and the > current flatten not so much). > > A patch that preserves the semantics of

Re: faster flatten?

2010-07-13 Thread Stuart Halloway
Hi Cam, Your tests aren't testing the interesting part without a doall. That said, my quick tests with doall show your approach faring even better. :-) Also, I think what my-flatten does with Java arrays is intuitive (and the current flatten not so much). A patch that preserves the sema

Re: faster flatten?

2010-07-12 Thread Mark Engelberg
Unless you wrap a "doall" around the calls to flatten and my-flatten, you're not really timing anything relevant. -- 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

faster flatten?

2010-07-12 Thread Cam
Another flatten thread! Sorry.. Hello all, before I realized there was a flatten in the master branch (and before I looked at contrib) I wrote this pretty standard code: (defn my-flatten [coll] (lazy-seq (when-let [coll (seq coll)] (let [x (first coll)] (if (sequential? x

Re: A better flatten

2009-09-02 Thread Meikel Brandmeyer
On Sep 3, 1:13 am, Sudish Joseph wrote: > (defn flatten-2 [lst] >   (lazy-seq >     (if-let [x (first lst)] >       (let [xs (rest lst)] >         (if (seq? x) >           (concat (flatten-2 x) (flatten-2 xs)) >           (cons x (flatten-2 xs))) This version is brok

Re: A better flatten

2009-09-02 Thread Krukow
On Sep 3, 1:13 am, Sudish Joseph wrote: > The other solutions seem higher level, but it's worth noting that > destructuring -- (let [[x & xs] lst] ...) -- uses next and is therefore > not fully lazy in that you will peek ahead by one into the lazy > sequence, so to speak.  You have to use explic

Re: A better flatten

2009-09-02 Thread Sudish Joseph
;; with destructuring (defn flatten [lst] (lazy-seq (if (empty? lst) lst (let [[x & xs] lst] (if (list? x) (concat (flatten x) (flatten xs)) (cons x (flatten xs))) ;; explicit first / rest (defn flatten-2 [lst] (lazy-seq (if-let

A better flatten

2009-09-02 Thread Krukow
Hello, At some point I needed at "flatten" function taking a list of atomic elements or nested lists, and producting a "flat" list of only atomic elements (in the same order). It should be lazy. This is what I came up with. Can anyone see a more elegant solution (I feel I a

Re: A better flatten

2009-09-02 Thread Sean Devlin
It's in c.c.seq-utils You can look up stuff here: http://richhickey.github.com/clojure-contrib/api-index.html On Sep 2, 4:12 pm, tmountain wrote: > I believe the flatten in contrib is defined as follows. I can't > remember which module I found it in. > > (defn flatten

Re: A better flatten

2009-09-02 Thread tmountain
I believe the flatten in contrib is defined as follows. I can't remember which module I found it in. (defn flatten "Takes any nested combination of sequential things (lists, vectors, etc.) and returns their contents as a single, flat sequence. (flatten nil) returns nil."

Re: seq-utils testing reveals potential flatten bugs

2009-08-08 Thread Sean Devlin
My thought we to use the test cases as a specification for the desired behavior. 1. Assume that the following case is desired behavior [:a 1 2 :b 3] [[:a [1 2]] [:b 3]] My thought was that "If it's a seq, flatten it". That lead me to develop the test case above. Here

Re: seq-utils testing reveals potential flatten bugs

2009-08-08 Thread Meikel Brandmeyer
Hi, Am 08.08.2009 um 07:36 schrieb Sean Devlin: In my opinion, flatten to behave more like this: http://gist.github.com/164291 May I ask a stupid question? What is the use of this case: [:a 1 2 :b 3] {:a [1 2] :b 3} Wouldn't it be more useful to flatten only depending o

seq-utils testing reveals potential flatten bugs

2009-08-07 Thread Sean Devlin
See Assembla ticket 13 in for clojure contrib to view the diff containing the test cases I just finished writing tests for the following functions in seq- utils: flatten separate includes? indexed group-by partition-by frequencies reductions rotations partition-all shuffle (invariants) rand-elt

flatten tools

2009-07-10 Thread kyle smith
I wrote these and thought they might be useful. Feel free to add them to clojure.contrib.seq-utils (defn flatten-n [n coll] "Like flatten, but only goes n levels deep." (if (= n 0) coll (recur (dec n) (apply concat (map #(if (sequential? %) % (list %)) coll) (defn-

Re: How to flatten a coll only 1 level deep?

2009-04-09 Thread Paul Drummond
2009/4/9 Chouser : > (defn flat1 [coll] >  (mapcat #(if (coll? %) % [%]) coll)) Ah, I see. So for each item, if its already a collection we leave it alone and if not we make a vector of one item, then at the end we use mapcat to concatinate all the top-level items into one list. Excellent - tha

Re: How to flatten a coll only 1 level deep?

2009-04-08 Thread Chouser
On Wed, Apr 8, 2009 at 10:10 PM, Paul Drummond wrote: > > I am looking for something similar to flatten (in contrib.seq-utils) > but the function will only flatten one level deep: > > [ 1 2 3 [4 5 [6 7] ] ] ---> [ 1 2 3 4 5 [6 7] ] > > I have tried combining functions in

How to flatten a coll only 1 level deep?

2009-04-08 Thread Paul Drummond
I am looking for something similar to flatten (in contrib.seq-utils) but the function will only flatten one level deep: [ 1 2 3 [4 5 [6 7] ] ] ---> [ 1 2 3 4 5 [6 7] ] I have tried combining functions in the seq library and I've studied the code for flatten and tree-seq to look for hint

Re: Flatten a list

2009-02-25 Thread Jeffrey Straszheim
I always end up doing (filter identity '(:fred :mary nil :sue)) (remove nil? ...) is actually more clear. I'll try to remember that. On Tue, Feb 24, 2009 at 10:42 PM, Timothy Pratley wrote: > > user=> (remove nil? '(:a nil nil :b :a)) > (:a :b :a) > > On Feb 25, 2:38 pm, Sean wrote: > > I've go

Re: Flatten a list

2009-02-24 Thread Sean
On Feb 24, 11:35 pm, David Sletten wrote: > On Feb 24, 2009, at 6:07 PM, David Sletten wrote: > > > > > (defn kill-nil > >    ([l] (kill-nil l '())) > >    ([l result] (cond (nil? l) (reverse result) > >                      (nil? (first l)) (recur (rest l) result) > >                      true

Re: Flatten a list

2009-02-24 Thread David Sletten
On Feb 24, 2009, at 6:07 PM, David Sletten wrote: > > (defn kill-nil >([l] (kill-nil l '())) >([l result] (cond (nil? l) (reverse result) > (nil? (first l)) (recur (rest l) result) > true (recur (rest l) (cons (first l) result ) > > I forgot

Re: Flatten a list

2009-02-24 Thread David Sletten
On Feb 24, 2009, at 5:42 PM, Timothy Pratley wrote: > > user=> (remove nil? '(:a nil nil :b :a)) > (:a :b :a) > > C'mon! Doesn't anybody do things the old-fashioned way anymore? (defn kill-nil ([l] (kill-nil l '())) ([l result] (cond (nil? l) (reverse result) (nil? (

Re: Flatten a list

2009-02-24 Thread Sean
Awesome! Thanks guys! On Feb 24, 10:42 pm, Timothy Pratley wrote: > user=> (remove nil? '(:a nil nil :b :a)) > (:a :b :a) > > On Feb 25, 2:38 pm, Sean wrote: > > > I've got the following list > > > (:a nil nil :b :a) > > > I want to call a "nil-killer" function, and get the following list > >

Re: Flatten a list

2009-02-24 Thread Timothy Pratley
user=> (remove nil? '(:a nil nil :b :a)) (:a :b :a) On Feb 25, 2:38 pm, Sean wrote: > I've got the following list > > (:a nil nil :b :a) > > I want to call a "nil-killer" function, and get the following list > > (:a :b :a) > > How do I go about this?  Could someone post a quick example? --~--~--

Re: Flatten a list

2009-02-24 Thread Kevin Downey
filter, http://clojure.org/api#filter On Tue, Feb 24, 2009 at 7:38 PM, Sean wrote: > > I've got the following list > > (:a nil nil :b :a) > > I want to call a "nil-killer" function, and get the following list > > (:a :b :a) > > How do I go about this?  Could someone post a quick example? > > >

Flatten a list

2009-02-24 Thread Sean
I've got the following list (:a nil nil :b :a) I want to call a "nil-killer" function, and get the following list (:a :b :a) How do I go about this? Could someone post a quick example? --~--~-~--~~~---~--~~ You received this message because you are subscribed t

More Concise flatten, separate

2008-10-17 Thread Mark McGranaghan
Now that we have "remove" (and "sequential?"), perhaps we should redefine flatten and separate: (defn flatten "Takes any nested combination of sequential things (lists, vectors, etc.) and returns their contents as a single, flat sequence." [x] (remove se