<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Clojure: Checking for a nil value in a collection</title>
	<atom:link href="http://www.markhneedham.com/blog/2009/11/21/clojure-checking-for-a-nil-value-in-a-collection/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.markhneedham.com/blog/2009/11/21/clojure-checking-for-a-nil-value-in-a-collection/</link>
	<description>Thoughts on Software Development</description>
	<lastBuildDate>Wed, 17 Mar 2010 23:38:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: John Hume</title>
		<link>http://www.markhneedham.com/blog/2009/11/21/clojure-checking-for-a-nil-value-in-a-collection/comment-page-1/#comment-27083</link>
		<dc:creator>John Hume</dc:creator>
		<pubDate>Sun, 22 Nov 2009 17:26:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=1856#comment-27083</guid>
		<description>Oops ... clearly I haven&#039;t been writing enough Clojure recently. I stick by my assertion that `some` isn&#039;t a predicate, but it returns the first logically true result of applying the first argument (not the value that yielded the logical true, as I previously stated). Given this, it will always just return true or nil if you give it a true predicate function as the first argument.

There are these though:

(some #{:foo :bar} [:baz :bar]) =&gt; :bar

(some {:a &quot;Aye&quot; :b &quot;Bee&quot;} [:c :b]) =&gt; &quot;Bee&quot;</description>
		<content:encoded><![CDATA[<p>Oops &#8230; clearly I haven't been writing enough Clojure recently. I stick by my assertion that `some` isn't a predicate, but it returns the first logically true result of applying the first argument (not the value that yielded the logical true, as I previously stated). Given this, it will always just return true or nil if you give it a true predicate function as the first argument.</p>
<p>There are these though:</p>
<p>(some #{:foo :bar} [:baz :bar]) =&gt; :bar</p>
<p>(some {:a "Aye" :b "Bee"} [:c :b]) =&gt; "Bee"</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Hume</title>
		<link>http://www.markhneedham.com/blog/2009/11/21/clojure-checking-for-a-nil-value-in-a-collection/comment-page-1/#comment-27082</link>
		<dc:creator>John Hume</dc:creator>
		<pubDate>Sun, 22 Nov 2009 17:14:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=1856#comment-27082</guid>
		<description>I don&#039;t think Clojure prefers nil over false. Note that it&#039;s `some`, not `some?`: it isn&#039;t a predicate for seeing whether something in the collection satisfies another predicate, rather it&#039;s a function for getting some element that satisfies a given predicate. (There is, however, no predicate for doing this job, while there are `every?`, `not-every?`, and `not-any?`, so it ends up used in place of a predicate often, thanks to nil being falsey.)</description>
		<content:encoded><![CDATA[<p>I don't think Clojure prefers nil over false. Note that it's `some`, not `some?`: it isn't a predicate for seeing whether something in the collection satisfies another predicate, rather it's a function for getting some element that satisfies a given predicate. (There is, however, no predicate for doing this job, while there are `every?`, `not-every?`, and `not-any?`, so it ends up used in place of a predicate often, thanks to nil being falsey.)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
