So it looks like this might be perfect for what I need.  I need to track a 
hash of the key fields of inserted db records so I can skip duplicates 
without db access.

On Thursday, February 14, 2013 7:35:20 PM UTC-5, Luc wrote:

> Look at the first example here: 
>
> http://clojuredocs.org/clojure_core/clojure.core/transient 
>
> It should inspire you. 
>
> Transient structures make this kind of loop run faster but as you lay out 
> your first iteration just toss this aside (and the xxx! version of conj 
> and cie). 
>
> Luc P. 
>
>
> > I have a loop over a function that is accumulating a list of database 
> keys 
> > for later use.  But it is primarily doing other processing and returning 
> a 
> > collection of processed/filtered records.  I'd normally just PUSH the 
> ids 
> > and records onto a list in Common Lisp, or even LOOP... COLLECT into 2 
> > lists.  In the Clojure way, how would I build this auxiliary list 
> without 
> > using a mutable collection?  Would it make sense to return a map or some 
> > other structure from the processing function that would contain both the 
> > processed record as well as any id of interest?  I could accumulate this 
> > result, then filter the map into 2 collections - one of processed 
> records 
> > and the other a subset of id's of interest.  But that seems kludgy 
> > commingling the results like that. 
> > 
> > -- 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Clojure" group. 
> > To post to this group, send email to clo...@googlegroups.com<javascript:> 
> > Note that posts from new members are moderated - please be patient with 
> your first post. 
> > To unsubscribe from this group, send email to 
> > clojure+u...@googlegroups.com <javascript:> 
> > For more options, visit this group at 
> > http://groups.google.com/group/clojure?hl=en 
> > --- 
> > You received this message because you are subscribed to the Google 
> Groups "Clojure" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to clojure+u...@googlegroups.com <javascript:>. 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> > 
> > 
> > 
> -- 
> Softaddicts<lprefo...@softaddicts.ca <javascript:>> sent by ibisMail from 
> my ipad! 
>

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to