Re: Construct map without associng nil values..

2011-07-18 Thread Sean Corfield
On Mon, Jul 18, 2011 at 3:23 PM, Ken Wesson wrote: > On Mon, Jul 18, 2011 at 6:09 PM, Andreas Liljeqvist wrote: >> Thanks, but I still feel that it's a little verbose though. >> Is there some sort of thrush that returns nil if any steps are nil? >> One might do something like this: >> (--> e .get

Re: Construct map without associng nil values..

2011-07-18 Thread Ken Wesson
On Mon, Jul 18, 2011 at 6:09 PM, Andreas Liljeqvist wrote: > Thanks, but I still feel that it's a little verbose though. > Is there some sort of thrush that returns nil if any steps are nil? > One might do something like this: > (--> e .getComments (hashmap :comments)) There's -?> in, I think, co

Re: Construct map without associng nil values..

2011-07-18 Thread Andreas Liljeqvist
Thanks, but I still feel that it's a little verbose though. Is there some sort of thrush that returns nil if any steps are nil? One might do something like this: (--> e .getComments (hashmap :comments)) not necessarily clear though... 2011/7/18 Meikel Brandmeyer > Hi, > > Am Montag, 18. Juli 2

Re: Construct map without associng nil values..

2011-07-18 Thread Meikel Brandmeyer
Hi, Am Montag, 18. Juli 2011 16:48:05 UTC+2 schrieb bonega: > > Got something like this: > > (for [e entries] > {:filename (.getName e) >:comment (.getComment e) >:manymorekeys xxx}) > > Quite often I get nil as comments. Problem is that I don't want any keys > added for com

Construct map without associng nil values..

2011-07-18 Thread Andreas Liljeqvist
Got something like this: (for [e entries] {:filename (.getName e) :comment (.getComment e) :manymorekeys xxx}) Quite often I get nil as comments. Problem is that I don't want any keys added for comment if there are none. I could wrap the whole thing in a (defn remove-nil-com