<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent questions tagged isa?</title>
<link>https://ask.clojure.org/index.php/tag/isa%3F</link>
<description></description>
<item>
<title>how to check whether an object is of a certain type</title>
<link>https://ask.clojure.org/index.php/9205/how-to-check-whether-an-object-is-of-a-certain-type</link>
<description>&lt;p&gt;Looking at the documentation for &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojuredocs.org/clojure.core/type&quot;&gt;type&lt;/a&gt; I see how to find a type of an object.  And in the see-also section it talks about the function &lt;code&gt;instance?&lt;/code&gt; which tests whether an object is a member of a designated class.  &lt;/p&gt;
&lt;p&gt;Is the documentation using the word class and type interchangeably here?&lt;br&gt;
What is the correct way to check type membership, assuming I have a type designator compatible with &lt;code&gt;isa?&lt;/code&gt; ?&lt;/p&gt;
</description>
<category>Records and Types</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9205/how-to-check-whether-an-object-is-of-a-certain-type</guid>
<pubDate>Wed, 01 Apr 2020 09:10:09 +0000</pubDate>
</item>
<item>
<title>generalizing isa?</title>
<link>https://ask.clojure.org/index.php/9204/generalizing-isa</link>
<description>&lt;p&gt;I'm trying to understand how to use the &lt;code&gt;isa?&lt;/code&gt; function, but I don't yet understand exactly what the valid arguments of this function are, but somehow they are type-designators, or type-names, or whatever the clojure terminology for that is.&lt;br&gt;
My question is: given two valid type-designators for &lt;code&gt;isa?&lt;/code&gt; how do I find out whether the two designated types intersect.  I.e., is it possible to have an object which is of both types?&lt;/p&gt;
&lt;p&gt;The &lt;a rel=&quot;nofollow&quot; href=&quot;https://blog.ambrosebs.com/2020/03/30/what-type-clojure.html&quot;&gt;blog post of Ambrose&lt;/a&gt; sort of hints at this enough to make me even more curious.&lt;br&gt;
As the blog post specifies, there is no equivalent of the Common Lisp &lt;code&gt;subtypep&lt;/code&gt; function in clojure.  But in Common Lisp I can ask whether type A is a subtype of B,  and I can express intersection types as (and A B).  Thus I can ask intersection questions by asking whether the intersection is a subtype of the empty type.  &lt;code&gt;(subtypep (and A B) nil)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;What is the closest to that that exists in clojure?&lt;/p&gt;
</description>
<category>Records and Types</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9204/generalizing-isa</guid>
<pubDate>Wed, 01 Apr 2020 07:35:02 +0000</pubDate>
</item>
</channel>
</rss>