I'm not sure I'm getting your data example (seems like there are some
characters missing or out of place) but this might be what you're
looking for:
user=> (def stuff
  [['(+ 1 (- 5 2)) nil]
   ['(- 5 2) nil]
   [3 true]
   [4 true]])
#'user/stuff
user=> (vec (for [m stuff] (vec (butlast m))))
[[(+ 1 (- 5 2))] [(- 5 2)] [3] [4]]

On Feb 11, 8:39 pm, jweiss <jeffrey.m.we...@gmail.com> wrote:
> I've been working on a tracing library, that works much like
> clojure.contrib.trace (based on it, actually).   One sticky problem
> I've found is, hierarchical logs are really crappy to try to stream to
> a file.  You can't just keep writing to the end of the file - new data
> needs to be inserted before existing end-tags.  So what I'm doing is
> storing the data as a list, until I know the data is complete, and
> then i turn it back into a tree to write the file.
>
> However I can't think of a simple way to do it, even though it seems
> like a simple operation.
>
> I want to turn this list of pairs (first item is the fn call or return
> value, the second is a truthy value marking whether it's a call or
> return)
>
> '[[(+ 1 (- 5 2) nil]
>  [(- 5 2) nil]
>  [3 true]
>  [4 true]]
>
> I want to turn that into
> [(+ 1 (- 5 2))
>     [(- 5 2)
>      3]
>  4]
>
> Is there a simple way to do this?

-- 
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 moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to