Another option is to take-while the values in the sequence are valid, and
then map over the ones that are.

- James


On 24 November 2013 16:50, Stuart Halloway <stuart.hallo...@gmail.com>wrote:

> Hi Dave,
>
> You can use reduce for this job, and have the reducing function return a
> (reduced retval) when you want to break out.
>
> Cheers,
> Stu
>
>
> On Sun, Nov 24, 2013 at 11:19 AM, David Simmons 
> <shortlypor...@gmail.com>wrote:
>
>> Hi All.
>>
>> Still struggling to get my head around Clojure - this is attempt number 4.
>>
>> I wish to process each item in a vector. I know I can use map to do this
>> e.g. (map my-func my-vector). My problem is that I need to be able to break
>> out of the map if my-func returns an error when processing any of the
>> items. I know map isn't what I'm looking for but is there a function or
>> some idiomatic piece of clojure to achieve my aim.
>>
>> cheers
>>
>> Dave
>>
>>  --
>> --
>> 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.
>>
>
>  --
> --
> 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.
>

-- 
-- 
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