<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Pre- and post-conditions: a quest for a nicer syntax</title>
	<atom:link href="http://onclojure.com/2010/03/05/pre-and-post-conditions-a-quest-for-a-nicer-syntax/feed/" rel="self" type="application/rss+xml" />
	<link>http://onclojure.com/2010/03/05/pre-and-post-conditions-a-quest-for-a-nicer-syntax/</link>
	<description>A blog about everything Clojure</description>
	<lastBuildDate>Thu, 09 May 2013 14:29:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: nickik</title>
		<link>http://onclojure.com/2010/03/05/pre-and-post-conditions-a-quest-for-a-nicer-syntax/#comment-113</link>
		<dc:creator><![CDATA[nickik]]></dc:creator>
		<pubDate>Fri, 16 Jul 2010 12:13:05 +0000</pubDate>
		<guid isPermaLink="false">http://onclojure.com/?p=104#comment-113</guid>
		<description><![CDATA[I think your looking for something like this: http://github.com/fogus/trammel

Look at his blog too!]]></description>
		<content:encoded><![CDATA[<p>I think your looking for something like this: <a href="http://github.com/fogus/trammel" rel="nofollow">http://github.com/fogus/trammel</a></p>
<p>Look at his blog too!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: khinsen</title>
		<link>http://onclojure.com/2010/03/05/pre-and-post-conditions-a-quest-for-a-nicer-syntax/#comment-90</link>
		<dc:creator><![CDATA[khinsen]]></dc:creator>
		<pubDate>Mon, 22 Mar 2010 16:03:34 +0000</pubDate>
		<guid isPermaLink="false">http://onclojure.com/?p=104#comment-90</guid>
		<description><![CDATA[You are right about preconditions that depend on several arguments, but I think this is a minor point: I am not trying to replace the general syntax for preconditions, all I want is to add another one for frequent special cases. Generality is thus not very important.

As for separating the contract from the argument list, that&#039;s actually what I am trying to avoid. For me the contract is as much part of the interface as the number of arguments or the function name. I may want to turn off the verification of the contract, for performance reasons, but that can be achieved by disabling assertions. I don&#039;t imagine not wanting the contract any more.

However, I do agree with your point about readability. The conditions tend to take up much more space than the argument they refer to, making it more difficult to spot the argument visually. This could probably be solved by syntax-coloring in the editor, though I don&#039;t expect all editors and IDEs to implement my personal syntax.]]></description>
		<content:encoded><![CDATA[<p>You are right about preconditions that depend on several arguments, but I think this is a minor point: I am not trying to replace the general syntax for preconditions, all I want is to add another one for frequent special cases. Generality is thus not very important.</p>
<p>As for separating the contract from the argument list, that&#8217;s actually what I am trying to avoid. For me the contract is as much part of the interface as the number of arguments or the function name. I may want to turn off the verification of the contract, for performance reasons, but that can be achieved by disabling assertions. I don&#8217;t imagine not wanting the contract any more.</p>
<p>However, I do agree with your point about readability. The conditions tend to take up much more space than the argument they refer to, making it more difficult to spot the argument visually. This could probably be solved by syntax-coloring in the editor, though I don&#8217;t expect all editors and IDEs to implement my personal syntax.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Normand</title>
		<link>http://onclojure.com/2010/03/05/pre-and-post-conditions-a-quest-for-a-nicer-syntax/#comment-89</link>
		<dc:creator><![CDATA[Eric Normand]]></dc:creator>
		<pubDate>Sun, 21 Mar 2010 16:04:16 +0000</pubDate>
		<guid isPermaLink="false">http://onclojure.com/?p=104#comment-89</guid>
		<description><![CDATA[I like the idea, but I have some reservations.

First, there is a case you haven&#039;t mentioned: precondition predicates that operate on more than one argument.  You could specify that the predicates are all executed in an environment where all arguments are bound.

But I kind of like having the contract separate.  It&#039;s easier to add and remove if you no longer want it.

And parsing the argument list becomes more complicated for the compiler and the human reader.  Keeping them separate is my preference.

Eric]]></description>
		<content:encoded><![CDATA[<p>I like the idea, but I have some reservations.</p>
<p>First, there is a case you haven&#8217;t mentioned: precondition predicates that operate on more than one argument.  You could specify that the predicates are all executed in an environment where all arguments are bound.</p>
<p>But I kind of like having the contract separate.  It&#8217;s easier to add and remove if you no longer want it.</p>
<p>And parsing the argument list becomes more complicated for the compiler and the human reader.  Keeping them separate is my preference.</p>
<p>Eric</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Destillat #11 &#124; duetsch.info - Open Source, Wet-, Web-, Software</title>
		<link>http://onclojure.com/2010/03/05/pre-and-post-conditions-a-quest-for-a-nicer-syntax/#comment-85</link>
		<dc:creator><![CDATA[Destillat #11 &#124; duetsch.info - Open Source, Wet-, Web-, Software]]></dc:creator>
		<pubDate>Mon, 08 Mar 2010 12:16:53 +0000</pubDate>
		<guid isPermaLink="false">http://onclojure.com/?p=104#comment-85</guid>
		<description><![CDATA[[...] Pre- and post-conditions: a quest for a nicer syntax [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Pre- and post-conditions: a quest for a nicer syntax [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zahardzhan</title>
		<link>http://onclojure.com/2010/03/05/pre-and-post-conditions-a-quest-for-a-nicer-syntax/#comment-84</link>
		<dc:creator><![CDATA[zahardzhan]]></dc:creator>
		<pubDate>Sat, 06 Mar 2010 22:25:19 +0000</pubDate>
		<guid isPermaLink="false">http://onclojure.com/?p=104#comment-84</guid>
		<description><![CDATA[&quot;Destructuring&quot; can be used like this, with [(automaticaly generated anonymous functions here %)]

(n
:is [pos? integer? (or (&gt; 10 %) (&lt; 5 %))] 
:is [neg? float?] ;; other :is act like or-clauses
:is [zero? double?]
:is (identical? 3 %)
:is number?
:type String ;; type declaration for optimization
:ignore ;; like in Common Lisp
:or 0) ;; when checking failed set n to 0

And, i think there must be way to write predicates without []-parens around.

You may try to read some code in my post in russian - there so few lines of code.]]></description>
		<content:encoded><![CDATA[<p>&#8220;Destructuring&#8221; can be used like this, with [(automaticaly generated anonymous functions here %)]</p>
<p>(n<br />
:is [pos? integer? (or (&gt; 10 %) (&lt; 5 %))]<br />
:is [neg? float?] ;; other :is act like or-clauses<br />
:is [zero? double?]<br />
:is (identical? 3 %)<br />
:is number?<br />
:type String ;; type declaration for optimization<br />
:ignore ;; like in Common Lisp <img src='http://s1.wp.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> r 0) ;; when checking failed set n to 0</p>
<p>And, i think there must be way to write predicates without []-parens around.</p>
<p>You may try to read some code in my post in russian &#8211; there so few lines of code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: khinsen</title>
		<link>http://onclojure.com/2010/03/05/pre-and-post-conditions-a-quest-for-a-nicer-syntax/#comment-83</link>
		<dc:creator><![CDATA[khinsen]]></dc:creator>
		<pubDate>Sat, 06 Mar 2010 17:50:32 +0000</pubDate>
		<guid isPermaLink="false">http://onclojure.com/?p=104#comment-83</guid>
		<description><![CDATA[With your parenthesis-free syntax, how do you handle conditions that need parameters? As I see it, you&#039;d have to define an anonymous literal each time.

Concerning your post about function combinators, my Russian isn&#039;t quite up to it I am afraid!]]></description>
		<content:encoded><![CDATA[<p>With your parenthesis-free syntax, how do you handle conditions that need parameters? As I see it, you&#8217;d have to define an anonymous literal each time.</p>
<p>Concerning your post about function combinators, my Russian isn&#8217;t quite up to it I am afraid!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bsteuber</title>
		<link>http://onclojure.com/2010/03/05/pre-and-post-conditions-a-quest-for-a-nicer-syntax/#comment-81</link>
		<dc:creator><![CDATA[bsteuber]]></dc:creator>
		<pubDate>Sat, 06 Mar 2010 09:00:18 +0000</pubDate>
		<guid isPermaLink="false">http://onclojure.com/?p=104#comment-81</guid>
		<description><![CDATA[I like that =)

(And I prefer the &quot;parenthetic&quot; version)]]></description>
		<content:encoded><![CDATA[<p>I like that =)</p>
<p>(And I prefer the &#8220;parenthetic&#8221; version)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zahardzhan</title>
		<link>http://onclojure.com/2010/03/05/pre-and-post-conditions-a-quest-for-a-nicer-syntax/#comment-80</link>
		<dc:creator><![CDATA[zahardzhan]]></dc:creator>
		<pubDate>Sat, 06 Mar 2010 03:46:21 +0000</pubDate>
		<guid isPermaLink="false">http://onclojure.com/?p=104#comment-80</guid>
		<description><![CDATA[Or it&#039;s better to add some sort of &#039;destructuring&#039; for variables http://gist.github.com/323481

(defn (power :is number? :or #(throw &#039;Bad-input))
[(x :is number?)
(y :is [pos? integer?])
(n :is [pos? integer?] :is [neg? float?] :is [zero? double?] :or false)]
(/ x 0))]]></description>
		<content:encoded><![CDATA[<p>Or it&#8217;s better to add some sort of &#8216;destructuring&#8217; for variables <a href="http://gist.github.com/323481" rel="nofollow">http://gist.github.com/323481</a></p>
<p>(defn (power :is number? <img src='http://s1.wp.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> r #(throw &#8216;Bad-input))<br />
[(x :is number?)<br />
(y :is [pos? integer?])<br />
(n :is [pos? integer?] :is [neg? float?] :is [zero? double?] <img src='http://s1.wp.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> r false)]<br />
(/ x 0))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zahardzhan</title>
		<link>http://onclojure.com/2010/03/05/pre-and-post-conditions-a-quest-for-a-nicer-syntax/#comment-79</link>
		<dc:creator><![CDATA[zahardzhan]]></dc:creator>
		<pubDate>Sat, 06 Mar 2010 03:26:46 +0000</pubDate>
		<guid isPermaLink="false">http://onclojure.com/?p=104#comment-79</guid>
		<description><![CDATA[I write a post about fn/and and fn/or function combinators http://zahardzhan.posterous.com/-fnand-fnor-fnnot
Pre and post conditions is full of implicit fn/and. What do you think about it?

And, also, there are toooo much parenthesis in your syntax. It should be something like that:
(defn power :is number?
  [x :is number?
   y :is (pos? integer?)
   n :is (or (pos? integer?)
             (neg? float?))]
  (apply * (repeat n x)))]]></description>
		<content:encoded><![CDATA[<p>I write a post about fn/and and fn/or function combinators <a href="http://zahardzhan.posterous.com/-fnand-fnor-fnnot" rel="nofollow">http://zahardzhan.posterous.com/-fnand-fnor-fnnot</a><br />
Pre and post conditions is full of implicit fn/and. What do you think about it?</p>
<p>And, also, there are toooo much parenthesis in your syntax. It should be something like that:<br />
(defn power :is number?<br />
  [x :is number?<br />
   y :is (pos? integer?)<br />
   n :is (or (pos? integer?)<br />
             (neg? float?))]<br />
  (apply * (repeat n x)))</p>
]]></content:encoded>
	</item>
</channel>
</rss>
