<!-- 
RSS generated by JIRA (4.4#649-r158309) at Sat May 25 09:05:56 CDT 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://dev.clojure.org/jira/si/jira.issueviews:issue-xml/CLJ-1141/CLJ-1141.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Clojure JIRA</title>
    <link>http://dev.clojure.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>4.4</version>
        <build-number>649</build-number>
        <build-date>25-07-2011</build-date>
    </build-info>

<item>
            <title>[CLJ-1141] Allow pre and post-conditions in defprotocol and deftype macros</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-1141</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;The fn special form and the defn macro allow pre- and post-conditions. It would be nice if one could use that conditions also in method declarations of the defprotocol and deftype macro.&lt;/p&gt;

&lt;p&gt;Currently I use the extend function as workaround where one can specify the methods using a map of keyword-name and fn special form.&lt;/p&gt;</description>
                <environment>Dos not matter.</environment>
            <key id="15937">CLJ-1141</key>
            <summary>Allow pre and post-conditions in defprotocol and deftype macros</summary>
                <type id="4" iconUrl="http://dev.clojure.org/jira/images/icons/improvement.gif">Enhancement</type>
                                <priority id="4" iconUrl="http://dev.clojure.org/jira/images/icons/priority_minor.gif">Minor</priority>
                    <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="akiel">Alexander Kiel</reporter>
                        <labels>
                    </labels>
                <created>Wed, 2 Jan 2013 05:08:13 -0600</created>
                <updated>Mon, 7 Jan 2013 17:28:42 -0600</updated>
                                    <version>Release 1.4</version>
                                                        <due></due>
                    <votes>1</votes>
                        <watches>3</watches>
                        <comments>
                    <comment id="30381" author="michael-drogalis" created="Sun, 6 Jan 2013 18:22:35 -0600"  >&lt;p&gt;Using &lt;tt&gt;:pre&lt;/tt&gt; and &lt;tt&gt;:post&lt;/tt&gt;, IMO, isn&apos;t a good idea. Handling assertions is a two part game. The mechanism needs to account for both detection and reaction, and the latter is missing.&lt;/p&gt;

&lt;p&gt;This isn&apos;t a perfect work-around, as it&apos;s a little verbose, but using &lt;a href=&quot;https://github.com/MichaelDrogalis/dire&quot;&gt;Dire&lt;/a&gt; might work better than using extend. In addition, you get the &quot;reaction&quot; functionality that&apos;s missing from &lt;tt&gt;:pre&lt;/tt&gt; and &lt;tt&gt;:post&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Example for protocol preconditions: &lt;a href=&quot;https://gist.github.com/4471276&quot;&gt;https://gist.github.com/4471276&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="30396" author="akiel" created="Mon, 7 Jan 2013 11:52:08 -0600"  >&lt;p&gt;@Michael I read your &lt;a href=&quot;https://gist.github.com/4471276&quot;&gt;gist&lt;/a&gt; and the README of &lt;a href=&quot;https://github.com/MichaelDrogalis/dire&quot;&gt;Dire&lt;/a&gt;. I think the supervision concept of Erlang has it&apos;s places but I don&apos;t like it for pre- and post-conditions. For me, such conditions have two proposes: &lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;they should document the code and&lt;/li&gt;
	&lt;li&gt;they should fail fast to detect failures early.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;To support my first point, your pre- and post-conditions are just lexical too far away from the actual function definition. For the second point: I think in the case of violations the program should just crash. One could maybe wrap some part of the program with one of your exception supervisors handling an AssertionError. But I don&apos;t think that handling pre- and post-condition violations for individual functions is a good thing.&lt;/p&gt;</comment>
                    <comment id="30402" author="michael-drogalis" created="Mon, 7 Jan 2013 17:28:42 -0600"  >&lt;p&gt;@Alexander Indeed, your points are correct. Dire is meant to be exactly what you described. Lexically removed from application logic, and opportunity to recover from crashing. That was my best shot at aiding your needs quickly, anyway. &lt;img class=&quot;emoticon&quot; src=&quot;http://dev.clojure.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>
</channel>
</rss>