
{"id":35,"date":"2008-07-20T15:19:22","date_gmt":"2008-07-20T20:19:22","guid":{"rendered":"http:\/\/ikriv.com:8765\/blog\/?p=35"},"modified":"2008-07-20T15:19:22","modified_gmt":"2008-07-20T20:19:22","slug":"boolean-operations-in-f-spec-gone-bad","status":"publish","type":"post","link":"https:\/\/ikriv.com\/blog\/?p=35","title":{"rendered":"Boolean operations in F#: spec gone bad"},"content":{"rendered":"<p>The <a href=\"http:\/\/research.microsoft.com\/fsharp\/manual\/spec2.aspx\">F# language specification<\/a> does not talk much about Boolean operations, but it does say that <code>~~~<\/code> is <code>op_LogicalNot<\/code> and <code>&amp;&amp;&amp;<\/code> is a &#8220;bitwise and&#8221;, also called <code>land<\/code>. The <code>&amp;&amp;<\/code> operator is said to be an &#8220;address-of&#8221; expression.<\/p>\n<p>In reality <code>if ~~~<i>condition<\/i><\/code> does not work: it complains that <code>bool<\/code> does not define operator <code>~~~<\/code>. What works is <code>if not condition<\/code>.<\/p>\n<p>If <code>if a &amp;&amp;&amp; b<\/code> does not work either. What works is <code>if a &amp;&amp; b<\/code>. So much for the address-of operator. I am not sure why it is not possible to keep the spec straight and why I should second-guess such simple things&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The F# language specification does not talk much about Boolean operations, but it does say that ~~~ is op_LogicalNot and &amp;&amp;&amp; is a &#8220;bitwise and&#8221;, also called land. The &amp;&amp; <a href=\"https:\/\/ikriv.com\/blog\/?p=35\" class=\"more-link\">[&hellip;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"Layout":"","footnotes":""},"categories":[10],"tags":[9],"class_list":["entry","author-ikriv","post-35","post","type-post","status-publish","format-standard","category-fsharp","tag-fsharp"],"_links":{"self":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/35","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=35"}],"version-history":[{"count":0,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/35\/revisions"}],"wp:attachment":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=35"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=35"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=35"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}