<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
<channel>
	<title>Comments for Bertrand Meyer's technology blog</title>
	
	<link>http://bertrandmeyer.com</link>
	<description>Software and Technology</description>
	<lastBuildDate>Sat, 31 Jul 2010 15:10:16 +0200</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/BertrandMeyer-comments" /><feedburner:info uri="bertrandmeyer-comments" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:browserFriendly></feedburner:browserFriendly><item>
		<title>Comment on Verification As a Matter Of Course by La programación en 10 años más « La Naturaleza Del Software</title>
		<link>http://bertrandmeyer.com/2010/03/29/verification-as-a-matter-of-course/comment-page-1/#comment-200</link>
		<dc:creator>La programación en 10 años más « La Naturaleza Del Software</dc:creator>
		<pubDate>Sat, 31 Jul 2010 15:10:16 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=1143#comment-200</guid>
		<description>[...] / Paradigmas / Personajes / Programación / Tecnología Skip to comments (0) ↓     De acuerdo a Bertrand Meyer, en diez años [...]</description>
		<content:encoded><![CDATA[<p>[...] / Paradigmas / Personajes / Programación / Tecnología Skip to comments (0) &darr; &nbsp;   De acuerdo a Bertrand Meyer, en diez años [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The one sure way to advance software engineering by Bertrand Meyer's technology blog » Blog Archive » Analyzing a software failure</title>
		<link>http://bertrandmeyer.com/2009/08/21/the-one-sure-way-to-advance-software-engineering/comment-page-1/#comment-175</link>
		<dc:creator>Bertrand Meyer's technology blog » Blog Archive » Analyzing a software failure</dc:creator>
		<pubDate>Mon, 24 May 2010 14:06:46 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=706#comment-175</guid>
		<description>[...] The one sure way to advance software engineering: this blog, see here. [2] Dwelling on the point: this blog, see here. [3] Dines Bjørner: The TSE Trading Rules, [...]</description>
		<content:encoded><![CDATA[<p>[...] The one sure way to advance software engineering: this blog, see here. [2] Dwelling on the point: this blog, see here. [3] Dines Bjørner: The TSE Trading Rules, [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The theory and calculus of aliasing by Bertrand Meyer</title>
		<link>http://bertrandmeyer.com/2010/01/21/the-theory-and-calculus-of-aliasing/comment-page-1/#comment-172</link>
		<dc:creator>Bertrand Meyer</dc:creator>
		<pubDate>Mon, 26 Apr 2010 15:28:28 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=935#comment-172</guid>
		<description>Sorry for the delay in "approving" this comment, for some reason I was not seeing it under Wordpress.

The calculus talks about expressions (including variables) denoting objects -- rather than the objects themselves, which only exist at run time)\. It is easy to see that an expression is no longer aliased: it disappears from the alias relation.

I use FrameMaker for anything a bit complicated typographically -- glad you like it.

-- BM</description>
		<content:encoded><![CDATA[<p>Sorry for the delay in &#8220;approving&#8221; this comment, for some reason I was not seeing it under Wordpress.</p>
<p>The calculus talks about expressions (including variables) denoting objects &#8212; rather than the objects themselves, which only exist at run time)\. It is easy to see that an expression is no longer aliased: it disappears from the alias relation.</p>
<p>I use FrameMaker for anything a bit complicated typographically &#8212; glad you like it.</p>
<p>&#8211; BM</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on A couple of loop examples by xosfaere</title>
		<link>http://bertrandmeyer.com/2010/01/28/a-couple-of-loop-examples/comment-page-1/#comment-171</link>
		<dc:creator>xosfaere</dc:creator>
		<pubDate>Mon, 26 Apr 2010 15:26:54 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=1025#comment-171</guid>
		<description>I like the idea of loops as expressions, allowing a declarative compositional style of programming.

I wonder what your view is on invariant data structures and LINQ style programming where you would write: list.All(item =&gt; item &gt; 0) - unfortunately we still cannot write list.All(&gt; 0) in a language such as C#. There are quite efficient invariant data structures like finger trees and it would appear natural in a concurrent world that we use invariance to protect ourselves from working on quicksand and invariant data structures also go like hand-in-glove with declarative query-style programming and is very easy to reason about.

Thoughts? :-)

Less appropos, I use contracts everywhere in my C# programs but since there is no syntactic support for them, they look much more ugly than Eiffel contracts.</description>
		<content:encoded><![CDATA[<p>I like the idea of loops as expressions, allowing a declarative compositional style of programming.</p>
<p>I wonder what your view is on invariant data structures and LINQ style programming where you would write: list.All(item =&gt; item &gt; 0) &#8211; unfortunately we still cannot write list.All(&gt; 0) in a language such as C#. There are quite efficient invariant data structures like finger trees and it would appear natural in a concurrent world that we use invariance to protect ourselves from working on quicksand and invariant data structures also go like hand-in-glove with declarative query-style programming and is very easy to reason about.</p>
<p>Thoughts? <img src='http://bertrandmeyer.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Less appropos, I use contracts everywhere in my C# programs but since there is no syntactic support for them, they look much more ugly than Eiffel contracts.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The other impediment to software engineering research by Bertrand Meyer</title>
		<link>http://bertrandmeyer.com/2010/04/25/the-other-impediment-to-software-engineering-research/comment-page-1/#comment-167</link>
		<dc:creator>Bertrand Meyer</dc:creator>
		<pubDate>Mon, 26 Apr 2010 13:52:51 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=1185#comment-167</guid>
		<description>You misread my text. I don't need a job with a software house (if only because I am involved on that side too). Serious software engineering research -- we are talking about academia, not industry -- should be able to work on real software, not just demos and prototypes.</description>
		<content:encoded><![CDATA[<p>You misread my text. I don&#8217;t need a job with a software house (if only because I am involved on that side too). Serious software engineering research &#8212; we are talking about academia, not industry &#8212; should be able to work on real software, not just demos and prototypes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on A couple of loop examples by Bertrand Meyer</title>
		<link>http://bertrandmeyer.com/2010/01/28/a-couple-of-loop-examples/comment-page-1/#comment-166</link>
		<dc:creator>Bertrand Meyer</dc:creator>
		<pubDate>Mon, 26 Apr 2010 11:22:02 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=1025#comment-166</guid>
		<description>Sorry for not approving this comment from January — for some reason Wordpress was not showing it to me (or I was not seeing it) until now.

By "approve" I don't mean that I agree, of course (but I hope you didn't think I was trying to censor your critique).

By using emotionally charged language you make it hard to answer factually; let me simply note that even the simple loop you propose can be significantly simplified:

&lt;ul&gt;&lt;strong&gt;across &lt;/strong&gt;list &lt;strong&gt;as &lt;/strong&gt;l &lt;strong&gt;loop &lt;/strong&gt;print (l.item) &lt;strong&gt;end&lt;/strong&gt;&lt;/ul&gt;

which I think reads better. You also do not say how you would write loops representing predicates, such as:

&lt;ul&gt;    &lt;strong&gt;across &lt;/strong&gt;list &lt;strong&gt;as &lt;/strong&gt;l &lt;strong&gt;all &lt;/strong&gt;l.item &gt; 0 &lt;strong&gt;end&lt;/strong&gt;&lt;/ul&gt;

which we have started to use extensively in contracts.

Thanks for the compliment, much appreciated, on the alias analysis work.

-- BM</description>
		<content:encoded><![CDATA[<p>Sorry for not approving this comment from January &#8212; for some reason Wordpress was not showing it to me (or I was not seeing it) until now.</p>
<p>By &#8220;approve&#8221; I don&#8217;t mean that I agree, of course (but I hope you didn&#8217;t think I was trying to censor your critique).</p>
<p>By using emotionally charged language you make it hard to answer factually; let me simply note that even the simple loop you propose can be significantly simplified:</p>
<ul><strong>across </strong>list <strong>as </strong>l <strong>loop </strong>print (l.item) <strong>end</strong></ul>
<p>which I think reads better. You also do not say how you would write loops representing predicates, such as:</p>
<ul>    <strong>across </strong>list <strong>as </strong>l <strong>all </strong>l.item > 0 <strong>end</strong></ul>
<p>which we have started to use extensively in contracts.</p>
<p>Thanks for the compliment, much appreciated, on the alias analysis work.</p>
<p>&#8211; BM</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The other impediment to software engineering research by william.tell</title>
		<link>http://bertrandmeyer.com/2010/04/25/the-other-impediment-to-software-engineering-research/comment-page-1/#comment-165</link>
		<dc:creator>william.tell</dc:creator>
		<pubDate>Mon, 26 Apr 2010 11:13:49 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=1185#comment-165</guid>
		<description>That sounds as if I meant that you should leave your academic position, sorry.  That's not what I meant.  But if you can get a grant to do "field research" as an employee of an ISV -- although any company with a software product would do -- that would be far preferable to sitting in an office and theorizing about what happens in the real world (not to imply that's the case with you, either).  I think that companies would jump at the opportunity to have a highly trained developer on their staff, effectively (presuming your grant covered some portion of their expenses in taking you on) for free, or very cheaply.  And you'd have the opportunity to see how software engineering is carried out in the "real" world.</description>
		<content:encoded><![CDATA[<p>That sounds as if I meant that you should leave your academic position, sorry.  That&#8217;s not what I meant.  But if you can get a grant to do &#8220;field research&#8221; as an employee of an ISV &#8212; although any company with a software product would do &#8212; that would be far preferable to sitting in an office and theorizing about what happens in the real world (not to imply that&#8217;s the case with you, either).  I think that companies would jump at the opportunity to have a highly trained developer on their staff, effectively (presuming your grant covered some portion of their expenses in taking you on) for free, or very cheaply.  And you&#8217;d have the opportunity to see how software engineering is carried out in the &#8220;real&#8221; world.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The other impediment to software engineering research by william.tell</title>
		<link>http://bertrandmeyer.com/2010/04/25/the-other-impediment-to-software-engineering-research/comment-page-1/#comment-164</link>
		<dc:creator>william.tell</dc:creator>
		<pubDate>Mon, 26 Apr 2010 11:10:30 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=1185#comment-164</guid>
		<description>You fail to consider the obvious alternative.  Get a job working in an actual software house creating -- or, better still -- maintaining production software.  If you think that hiring developers, testers, etc., to work in an academic environment as a part of a research effort is going to be any more realistic than it will be to have a Ph.D candidate developing software as a part of their thesis effort, you're mistaken.</description>
		<content:encoded><![CDATA[<p>You fail to consider the obvious alternative.  Get a job working in an actual software house creating &#8212; or, better still &#8212; maintaining production software.  If you think that hiring developers, testers, etc., to work in an academic environment as a part of a research effort is going to be any more realistic than it will be to have a Ph.D candidate developing software as a part of their thesis effort, you&#8217;re mistaken.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Dwelling on the point by Bertrand Meyer's technology blog » Blog Archive » The other impediment to software engineering research</title>
		<link>http://bertrandmeyer.com/2009/11/29/dwelling-on-the-point/comment-page-1/#comment-163</link>
		<dc:creator>Bertrand Meyer's technology blog » Blog Archive » The other impediment to software engineering research</dc:creator>
		<pubDate>Sun, 25 Apr 2010 15:09:50 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=869#comment-163</guid>
		<description>[...] way to advance software engineering: this blog, see here. [2] Dwelling on the point: this blog, see here.   var addthis_pub = ''; var addthis_language = 'en';var addthis_options = 'email, favorites, [...]</description>
		<content:encoded><![CDATA[<p>[...] way to advance software engineering: this blog, see here. [2] Dwelling on the point: this blog, see here.   var addthis_pub = &#39;&#39;; var addthis_language = &#39;en&#39;;var addthis_options = &#39;email, favorites, [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The one sure way to advance software engineering by Bertrand Meyer's technology blog » Blog Archive » The other impediment to software engineering research</title>
		<link>http://bertrandmeyer.com/2009/08/21/the-one-sure-way-to-advance-software-engineering/comment-page-1/#comment-162</link>
		<dc:creator>Bertrand Meyer's technology blog » Blog Archive » The other impediment to software engineering research</dc:creator>
		<pubDate>Sun, 25 Apr 2010 15:02:01 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=706#comment-162</guid>
		<description>[...] The one sure way to advance software engineering: this blog, see here. [2] Dwelling on the point: this blog, see here.   var addthis_pub = ''; var addthis_language = [...]</description>
		<content:encoded><![CDATA[<p>[...] The one sure way to advance software engineering: this blog, see here. [2] Dwelling on the point: this blog, see here.   var addthis_pub = &#39;&#39;; var addthis_language = [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on More expressive loops for Eiffel by Bertrand Meyer</title>
		<link>http://bertrandmeyer.com/2010/01/26/more-expressive-loops-for-eiffel/comment-page-1/#comment-159</link>
		<dc:creator>Bertrand Meyer</dc:creator>
		<pubDate>Mon, 29 Mar 2010 16:29:02 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=990#comment-159</guid>
		<description>Of course it is the same general idea as iterator constructs that have been offered for various programming languages, often (but not always) using the keyword `foreach'. 

There is an important semantic difference. If you consider the `across' construct carefully you will note that it is more powerful than typical "foreach" loops. The key is in the use of the cursor variable, following `as'. It adds considerable flexibility, for example by allowing access to the index of the element, to the index of the iteration (not necessarily the same!), to the previous element, the next element... Most "foreach" loops do not have this flexibility.

As to the choice of keyword: Eiffel avoids multi-word keywords for clarity, so `foreach' was not considered. A more natural-sounding choice would have been `over', but too many existing programs use this name as identifier; `across' was not to everybody's taste but seemed reasonable enough.

-- Bertrand Meyer
(Sorry for the delay in approving your comment for publication, I had no time to take care of the blog in recent weeks.)</description>
		<content:encoded><![CDATA[<p>Of course it is the same general idea as iterator constructs that have been offered for various programming languages, often (but not always) using the keyword `foreach&#8217;. </p>
<p>There is an important semantic difference. If you consider the `across&#8217; construct carefully you will note that it is more powerful than typical &#8220;foreach&#8221; loops. The key is in the use of the cursor variable, following `as&#8217;. It adds considerable flexibility, for example by allowing access to the index of the element, to the index of the iteration (not necessarily the same!), to the previous element, the next element&#8230; Most &#8220;foreach&#8221; loops do not have this flexibility.</p>
<p>As to the choice of keyword: Eiffel avoids multi-word keywords for clarity, so `foreach&#8217; was not considered. A more natural-sounding choice would have been `over&#8217;, but too many existing programs use this name as identifier; `across&#8217; was not to everybody&#8217;s taste but seemed reasonable enough.</p>
<p>&#8211; Bertrand Meyer<br />
(Sorry for the delay in approving your comment for publication, I had no time to take care of the blog in recent weeks.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on One cheer for incremental research by grappler</title>
		<link>http://bertrandmeyer.com/2009/08/10/one-cheer-for-incremental-research/comment-page-1/#comment-157</link>
		<dc:creator>grappler</dc:creator>
		<pubDate>Tue, 16 Mar 2010 20:59:35 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=373#comment-157</guid>
		<description>It seems to me that you are misunderstanding NSF's message. As someone who has served on several NSF panels and has had a significant involvement in assessing applications for funding in my own country - not the US -  I am painfully aware that many if not most applications for funding to these agencies are about tweaking an already well-understood method to produce yet another paper or ten. The ultimate aim of these proposed projects is tree-chopping - not science! I regularly read papers where the introduction promises to solve all of the world's problems  from cimate change to the global financial crisis, but once I am into the second section I realise that the "idea" is essentially trivial and could have been worked out by anyone with a modicum of intelligence in half an hour or less. This section  is followed others in which tedious simulations (called "experiments") are described which are  designed to "prove" that the idea works  - where is Karl Popper when we need him! Why should such a  paper occupy space in a so-called "top tier" journal? And yet I am sure you know of many journals and papers like this. By all means let science be incremental but let it at least be science! 

The NSF and many other funding agencies are well aware of this situation and are trying to do something about it.  Yes perhaps their language is a little hyped but at least it is a move in the right direction. Unfortunately with the whole of the academic research sector being "metricized" with h-factors, g-factors, impact factors,  and rankings to suit our bean-counting administrations they are fighting a losing battle. Just check for  yourself how many papers Andrew Wiles (solver of Fermat) or Perelman (solver of Poincare) have written over their careers and think about their real impact.</description>
		<content:encoded><![CDATA[<p>It seems to me that you are misunderstanding NSF&#8217;s message. As someone who has served on several NSF panels and has had a significant involvement in assessing applications for funding in my own country &#8211; not the US &#8211;  I am painfully aware that many if not most applications for funding to these agencies are about tweaking an already well-understood method to produce yet another paper or ten. The ultimate aim of these proposed projects is tree-chopping &#8211; not science! I regularly read papers where the introduction promises to solve all of the world&#8217;s problems  from cimate change to the global financial crisis, but once I am into the second section I realise that the &#8220;idea&#8221; is essentially trivial and could have been worked out by anyone with a modicum of intelligence in half an hour or less. This section  is followed others in which tedious simulations (called &#8220;experiments&#8221;) are described which are  designed to &#8220;prove&#8221; that the idea works  &#8211; where is Karl Popper when we need him! Why should such a  paper occupy space in a so-called &#8220;top tier&#8221; journal? And yet I am sure you know of many journals and papers like this. By all means let science be incremental but let it at least be science! </p>
<p>The NSF and many other funding agencies are well aware of this situation and are trying to do something about it.  Yes perhaps their language is a little hyped but at least it is a move in the right direction. Unfortunately with the whole of the academic research sector being &#8220;metricized&#8221; with h-factors, g-factors, impact factors,  and rankings to suit our bean-counting administrations they are fighting a losing battle. Just check for  yourself how many papers Andrew Wiles (solver of Fermat) or Perelman (solver of Poincare) have written over their careers and think about their real impact.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Reflexivity, and other pillars of civilization by opacus</title>
		<link>http://bertrandmeyer.com/2010/02/06/reflexivity-and-other-pillars-of-civilization/comment-page-1/#comment-155</link>
		<dc:creator>opacus</dc:creator>
		<pubDate>Mon, 22 Feb 2010 17:03:17 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=1054#comment-155</guid>
		<description>It is important to separate two questions.  The first is whether we agree that, for all x, x = x.  Most people would want to agree, and that is what the mathematical precedent really supports.  The second question is whether we agree that the expression 'x = x' should always be evaluated as true.  Whether or not people would agree with that, there is in fact strong mathematical precedent for disagreement, depending on the type of expression we substitute for 'x'.  If 'x' is a definite description then it follows from the theory in Whitehead and Russell's Principia Mathematica, for instance, that 'x = x' may well be false.  An expression containing definite descriptions always gets expanded in primitive notation to one which does not contain them.  So 'the biggest integer is even' turns into something like 'for just one integer x, for all integers y, both x is as large as y and x is even'.  That is, of course, false but then so is 'the biggest integer is the biggest integer' since that becomes 'for just one x, for just one y, for all integers z, x is as large as z and y is as large as z and x = y'.  So, in terms of programming languages there is no a-priori reason why 'x = x' might not be evaluated as false if the expression substituted for 'x' is really some kind of definite description which might fail to apply to one and only one item.</description>
		<content:encoded><![CDATA[<p>It is important to separate two questions.  The first is whether we agree that, for all x, x = x.  Most people would want to agree, and that is what the mathematical precedent really supports.  The second question is whether we agree that the expression &#8216;x = x&#8217; should always be evaluated as true.  Whether or not people would agree with that, there is in fact strong mathematical precedent for disagreement, depending on the type of expression we substitute for &#8216;x&#8217;.  If &#8216;x&#8217; is a definite description then it follows from the theory in Whitehead and Russell&#8217;s Principia Mathematica, for instance, that &#8216;x = x&#8217; may well be false.  An expression containing definite descriptions always gets expanded in primitive notation to one which does not contain them.  So &#8216;the biggest integer is even&#8217; turns into something like &#8216;for just one integer x, for all integers y, both x is as large as y and x is even&#8217;.  That is, of course, false but then so is &#8216;the biggest integer is the biggest integer&#8217; since that becomes &#8216;for just one x, for just one y, for all integers z, x is as large as z and y is as large as z and x = y&#8217;.  So, in terms of programming languages there is no a-priori reason why &#8216;x = x&#8217; might not be evaluated as false if the expression substituted for &#8216;x&#8217; is really some kind of definite description which might fail to apply to one and only one item.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on More expressive loops for Eiffel by Christian Reiter</title>
		<link>http://bertrandmeyer.com/2010/01/26/more-expressive-loops-for-eiffel/comment-page-1/#comment-153</link>
		<dc:creator>Christian Reiter</dc:creator>
		<pubDate>Tue, 16 Feb 2010 19:56:09 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=990#comment-153</guid>
		<description>I really aprecciate this possibility of writing loops but why isn't it called 'foreach' like in other languages? Why across? At first glance I thought of some kind of structures thats guarantees that each item is visited but the order is not determined.
Is it just because of the naming conventions or is there a more sophisticated reason?</description>
		<content:encoded><![CDATA[<p>I really aprecciate this possibility of writing loops but why isn&#8217;t it called &#8216;foreach&#8217; like in other languages? Why across? At first glance I thought of some kind of structures thats guarantees that each item is visited but the order is not determined.<br />
Is it just because of the naming conventions or is there a more sophisticated reason?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Reflexivity, and other pillars of civilization by dlebansais</title>
		<link>http://bertrandmeyer.com/2010/02/06/reflexivity-and-other-pillars-of-civilization/comment-page-1/#comment-151</link>
		<dc:creator>dlebansais</dc:creator>
		<pubDate>Mon, 08 Feb 2010 01:46:14 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=1054#comment-151</guid>
		<description>(My apologies for the reply spam)

There is also an interesting case of violated reflexivity in the Eiffel standard. Check ECMA-367 section 8.21.3

"The Boolean_expression e ~ f has value true if and only if the values of e and f are both attached and such that e.is_equal (f) holds."

In other word, with x: detachable ANY, x ~ x must yield False per the Eiffel standard.

Be reassured, under Eiffelstudio it yields True. :)</description>
		<content:encoded><![CDATA[<p>(My apologies for the reply spam)</p>
<p>There is also an interesting case of violated reflexivity in the Eiffel standard. Check ECMA-367 section 8.21.3</p>
<p>&#8220;The Boolean_expression e ~ f has value true if and only if the values of e and f are both attached and such that e.is_equal (f) holds.&#8221;</p>
<p>In other word, with x: detachable ANY, x ~ x must yield False per the Eiffel standard.</p>
<p>Be reassured, under Eiffelstudio it yields True. <img src='http://bertrandmeyer.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Reflexivity, and other pillars of civilization by dlebansais</title>
		<link>http://bertrandmeyer.com/2010/02/06/reflexivity-and-other-pillars-of-civilization/comment-page-1/#comment-150</link>
		<dc:creator>dlebansais</dc:creator>
		<pubDate>Mon, 08 Feb 2010 01:37:12 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=1054#comment-150</guid>
		<description>I forgot to mention that this definition of is_equal for REAL objects is likely to create havoc in the standard Eiffel libraries. I'll play with LIST[REAL] containing NaN when I have more time. Hopefully we don't end up with infinite loops and such oddities.</description>
		<content:encoded><![CDATA[<p>I forgot to mention that this definition of is_equal for REAL objects is likely to create havoc in the standard Eiffel libraries. I&#8217;ll play with LIST[REAL] containing NaN when I have more time. Hopefully we don&#8217;t end up with infinite loops and such oddities.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Reflexivity, and other pillars of civilization by dlebansais</title>
		<link>http://bertrandmeyer.com/2010/02/06/reflexivity-and-other-pillars-of-civilization/comment-page-1/#comment-149</link>
		<dc:creator>dlebansais</dc:creator>
		<pubDate>Mon, 08 Feb 2010 01:29:30 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=1054#comment-149</guid>
		<description>I think there are many topics related to this post and I'll try to summarize what each of them led me to think.

1. I don't have access to the standard as it seems the reference document is not free of charge. Why you must pay to know the standard is one topic but I'll leave it for another time. Wikipedia has a link to a recent draft (1.2.9) and I believe you're refering to section 7.11 that I will quote here:

"Comparisons are exact and never overflow or underflow. Four mutually exclusive relations are possible: less
than, equal, greater than, and unordered. The last case arises when at least one operand is NaN. Every NaN
shall compare unordered with everything, including itself. Comparisons shall ignore the sign of zero
(so +0 = −0). Infinite operands of the same sign shall compare equal.

Languages define how the result of a comparison shall be delivered, in one of two ways: either as a condition
code identifying one of the four relations listed above, or as a true-false response to a predicate that names the
specific comparison desired."

I didn't see anything else in this draft specifying that NaN comparison should yield false, however "Every NaN
shall compare unordered with everything, including itself" leaves no doubt about that since unordered is not equal.

Note that raising an exception would violate the standard, I believe, since comparing two numbers even if one is a NaN is a non-signaling operation.

2. I think the problem is that we want to maintain not two properties (equality is reflexive, and NaN /= NaN) but three, the third being that all objects can be compared. This is captured by the fact that is_equal is a feature of ANY, while other comparison features such as is_less come from specialized classes like COMPARABLE.

In a world with is_equal being a feature of an abstract class (EQUATABLE? It sounds ugly) the REAL class would not inherit this feature. Real numbers could not be compared with is_equal. They would be compared with a dedicated feature taking one of "less than", "equal", "greater than" and "unordered" as an argument, that could then safely return true or false as specified by the standard.

3. I've been confronted in the past with problems such as this one. Almost always, it comes from trying to mix orange and apples in a single value or concept. The way out is then to clearly separate the involved values and concepts in different entities. For instance, consider this definition of REAL:

class REAL
...
feature
value: ARRAY[INTEGER_8] -- The numeric value
meaningful: BOOLEAN     -- False if a NaN
...
end

Then the value of a number is separate from the boolean attribute that indicates if it has a meaning. The proper redefinition of is_equal becomes

is_equal (other: like Current): BOOLEAN
	do
		if meaningful and other.meaningful then
			result := value.is_equal(other.value)
		else
			result := False
		end
	end

This definition satisfies x /= x when x.meaningful is False.

4. You could argue that this is only an artificial trick to reconcile Eiffel contracts and the IEEE standard. I think it goes deeper than that. Equality in Eiffel, and probably all languages, is only an approximation of mathematical equality. If you asked, during a math course "does x = x?" then sure I'd answer yes. But during a computing course? I'd answer "depends...". Many aspects of computer languages are traductions of mathematical operations and properties that want to stay as close as the original concept, but never succeed that it.

There are well known examples. Take this function for instance:

identity_with_a_trick (n: INTEGER): INTEGER
	do
		result := n * 2
		result := result // 2
	ensure
		same_value: result = n
	end

It is naive to think that dividing or multiplying a number is harmless, it can raise an exception. The function above can raise a post-condition violation exception.

So to answer prof. Meyer's question "A programming language should support the venerable properties that equality is reflexive and that assignment yields equality (...) Do you agree?" I respectfully disagree in general, and fully agree when equality is defined for the objects being compared. IEEE 754 standard simply states it isn't.</description>
		<content:encoded><![CDATA[<p>I think there are many topics related to this post and I&#8217;ll try to summarize what each of them led me to think.</p>
<p>1. I don&#8217;t have access to the standard as it seems the reference document is not free of charge. Why you must pay to know the standard is one topic but I&#8217;ll leave it for another time. Wikipedia has a link to a recent draft (1.2.9) and I believe you&#8217;re refering to section 7.11 that I will quote here:</p>
<p>&#8220;Comparisons are exact and never overflow or underflow. Four mutually exclusive relations are possible: less<br />
than, equal, greater than, and unordered. The last case arises when at least one operand is NaN. Every NaN<br />
shall compare unordered with everything, including itself. Comparisons shall ignore the sign of zero<br />
(so +0 = −0). Infinite operands of the same sign shall compare equal.</p>
<p>Languages define how the result of a comparison shall be delivered, in one of two ways: either as a condition<br />
code identifying one of the four relations listed above, or as a true-false response to a predicate that names the<br />
specific comparison desired.&#8221;</p>
<p>I didn&#8217;t see anything else in this draft specifying that NaN comparison should yield false, however &#8220;Every NaN<br />
shall compare unordered with everything, including itself&#8221; leaves no doubt about that since unordered is not equal.</p>
<p>Note that raising an exception would violate the standard, I believe, since comparing two numbers even if one is a NaN is a non-signaling operation.</p>
<p>2. I think the problem is that we want to maintain not two properties (equality is reflexive, and NaN /= NaN) but three, the third being that all objects can be compared. This is captured by the fact that is_equal is a feature of ANY, while other comparison features such as is_less come from specialized classes like COMPARABLE.</p>
<p>In a world with is_equal being a feature of an abstract class (EQUATABLE? It sounds ugly) the REAL class would not inherit this feature. Real numbers could not be compared with is_equal. They would be compared with a dedicated feature taking one of &#8220;less than&#8221;, &#8220;equal&#8221;, &#8220;greater than&#8221; and &#8220;unordered&#8221; as an argument, that could then safely return true or false as specified by the standard.</p>
<p>3. I&#8217;ve been confronted in the past with problems such as this one. Almost always, it comes from trying to mix orange and apples in a single value or concept. The way out is then to clearly separate the involved values and concepts in different entities. For instance, consider this definition of REAL:</p>
<p>class REAL<br />
&#8230;<br />
feature<br />
value: ARRAY[INTEGER_8] &#8212; The numeric value<br />
meaningful: BOOLEAN     &#8212; False if a NaN<br />
&#8230;<br />
end</p>
<p>Then the value of a number is separate from the boolean attribute that indicates if it has a meaning. The proper redefinition of is_equal becomes</p>
<p>is_equal (other: like Current): BOOLEAN<br />
	do<br />
		if meaningful and other.meaningful then<br />
			result := value.is_equal(other.value)<br />
		else<br />
			result := False<br />
		end<br />
	end</p>
<p>This definition satisfies x /= x when x.meaningful is False.</p>
<p>4. You could argue that this is only an artificial trick to reconcile Eiffel contracts and the IEEE standard. I think it goes deeper than that. Equality in Eiffel, and probably all languages, is only an approximation of mathematical equality. If you asked, during a math course &#8220;does x = x?&#8221; then sure I&#8217;d answer yes. But during a computing course? I&#8217;d answer &#8220;depends&#8230;&#8221;. Many aspects of computer languages are traductions of mathematical operations and properties that want to stay as close as the original concept, but never succeed that it.</p>
<p>There are well known examples. Take this function for instance:</p>
<p>identity_with_a_trick (n: INTEGER): INTEGER<br />
	do<br />
		result := n * 2<br />
		result := result // 2<br />
	ensure<br />
		same_value: result = n<br />
	end</p>
<p>It is naive to think that dividing or multiplying a number is harmless, it can raise an exception. The function above can raise a post-condition violation exception.</p>
<p>So to answer prof. Meyer&#8217;s question &#8220;A programming language should support the venerable properties that equality is reflexive and that assignment yields equality (&#8230;) Do you agree?&#8221; I respectfully disagree in general, and fully agree when equality is defined for the objects being compared. IEEE 754 standard simply states it isn&#8217;t.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Reflexivity, and other pillars of civilization by Mattias Wikström</title>
		<link>http://bertrandmeyer.com/2010/02/06/reflexivity-and-other-pillars-of-civilization/comment-page-1/#comment-148</link>
		<dc:creator>Mattias Wikström</dc:creator>
		<pubDate>Sun, 07 Feb 2010 10:05:17 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=1054#comment-148</guid>
		<description>I think that regardless of whether you opt for NaN=NaN or NaN/=NaN there is good mathematics to back your decision. The full mathematical story is in any case much more complicated than what is captured by NaN's, and the responsibility for using them correctly must ultimately rest with the programmer.

If a1, a2, ... and b1, b2, ... are sequences of real numbers that both approach 0, then the sequence of quotients a1/b1, a2/b2, ... in general will not approach any real number, but will rather have a set of (extended) real numbers as its limit (the smallest of which is known as the inferior limit and the largest of which is known as the superior limit).

We can adopt the convention that an ordinary function applied to a set is equal to the set of function values, and we can then go on to calculate with sets of real numbers much as with real numbers (the first person to do this may have been Weierstrass). Let us now consider the question of equality between such sets. We know that {3, 4} and {4, 7} are different by ordinary set equality, but if we apply the equality function to the pairs (3, 4), (3, 7), (4, 4), and (4, 7) then the results will be False, False, True, and False, respectively, giving us the set {False, True}. In fact, we get the same result if we compare {3, 4} to itself.

How are we to interpret an equality that evaluates to {False, True}? If we interpret it as True then transitivity of equality will quickly lead to all real numbers allegedly being one and the same thing. I would say that what this really means is that there is a not-too-unnatural sense in which all real numbers are _equivalent_. If we interpret {False, True} as being False, then we allegedly have things/objects/entities which are not equal to themselves (or maybe I should say that we have a single thing/object/entity which is not equal to itself - without equality we have no standard for counting things.). Finally, we may prefer to restrict the domain of definition of our equality relation so that the cases that gave {False, True} are excluded from consideration.

Based on these three possibilities one might conclude that we cannot have NaN=NaN without getting x=y for any real numbers x and y (thus vindicating IEEE 754). However, we also have the set equality that makes {3, 4} distinct from {4, 7}, and we can use this type of equality to introduce yet another type of equality: We may consider all sets that contain more than one real number to be one and the same object, and we may call this object "NaN". In fact, there is mathematical research that supports treating NaN as a first-class object: See http://en.wikipedia.org/wiki/Wheel_theory .</description>
		<content:encoded><![CDATA[<p>I think that regardless of whether you opt for NaN=NaN or NaN/=NaN there is good mathematics to back your decision. The full mathematical story is in any case much more complicated than what is captured by NaN&#8217;s, and the responsibility for using them correctly must ultimately rest with the programmer.</p>
<p>If a1, a2, &#8230; and b1, b2, &#8230; are sequences of real numbers that both approach 0, then the sequence of quotients a1/b1, a2/b2, &#8230; in general will not approach any real number, but will rather have a set of (extended) real numbers as its limit (the smallest of which is known as the inferior limit and the largest of which is known as the superior limit).</p>
<p>We can adopt the convention that an ordinary function applied to a set is equal to the set of function values, and we can then go on to calculate with sets of real numbers much as with real numbers (the first person to do this may have been Weierstrass). Let us now consider the question of equality between such sets. We know that {3, 4} and {4, 7} are different by ordinary set equality, but if we apply the equality function to the pairs (3, 4), (3, 7), (4, 4), and (4, 7) then the results will be False, False, True, and False, respectively, giving us the set {False, True}. In fact, we get the same result if we compare {3, 4} to itself.</p>
<p>How are we to interpret an equality that evaluates to {False, True}? If we interpret it as True then transitivity of equality will quickly lead to all real numbers allegedly being one and the same thing. I would say that what this really means is that there is a not-too-unnatural sense in which all real numbers are _equivalent_. If we interpret {False, True} as being False, then we allegedly have things/objects/entities which are not equal to themselves (or maybe I should say that we have a single thing/object/entity which is not equal to itself &#8211; without equality we have no standard for counting things.). Finally, we may prefer to restrict the domain of definition of our equality relation so that the cases that gave {False, True} are excluded from consideration.</p>
<p>Based on these three possibilities one might conclude that we cannot have NaN=NaN without getting x=y for any real numbers x and y (thus vindicating IEEE 754). However, we also have the set equality that makes {3, 4} distinct from {4, 7}, and we can use this type of equality to introduce yet another type of equality: We may consider all sets that contain more than one real number to be one and the same object, and we may call this object &#8220;NaN&#8221;. In fact, there is mathematical research that supports treating NaN as a first-class object: See <a href="http://en.wikipedia.org/wiki/Wheel_theory" rel="nofollow">http://en.wikipedia.org/wiki/Wheel_theory</a> .</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Reflexivity, and other pillars of civilization by Bernd Schoeller</title>
		<link>http://bertrandmeyer.com/2010/02/06/reflexivity-and-other-pillars-of-civilization/comment-page-1/#comment-147</link>
		<dc:creator>Bernd Schoeller</dc:creator>
		<pubDate>Sun, 07 Feb 2010 08:51:55 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=1054#comment-147</guid>
		<description>This article is great and summarizes the problems with 754 very nicely.

Math is partial and there are different ways to handle this. Problems show when these ways are mixed, for example through the interactions between Boolean and Real.

One way is the use of NaN and any other 3-valued logic. But then, Boolean value should have a NaB. Another is the use of preconditions. That is what Eiffel uses. To be consistent, Eiffel should raise a precondition violation whenever an operation would produce a NaN.</description>
		<content:encoded><![CDATA[<p>This article is great and summarizes the problems with 754 very nicely.</p>
<p>Math is partial and there are different ways to handle this. Problems show when these ways are mixed, for example through the interactions between Boolean and Real.</p>
<p>One way is the use of NaN and any other 3-valued logic. But then, Boolean value should have a NaB. Another is the use of preconditions. That is what Eiffel uses. To be consistent, Eiffel should raise a precondition violation whenever an operation would produce a NaN.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Just another day at the office by Bertrand Meyer</title>
		<link>http://bertrandmeyer.com/2010/01/15/just-another-day-at-the-office/comment-page-1/#comment-144</link>
		<dc:creator>Bertrand Meyer</dc:creator>
		<pubDate>Sat, 06 Feb 2010 18:58:19 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=899#comment-144</guid>
		<description>You are right, I had omitted to mention that point. I updated the relevant part of the article to mention the need to save and restore the cursors. Actually in such cases I now use the new "across" loop variant, which uses an external cursor and maintains this automatically, so that one does not need to worry about such issues any more.</description>
		<content:encoded><![CDATA[<p>You are right, I had omitted to mention that point. I updated the relevant part of the article to mention the need to save and restore the cursors. Actually in such cases I now use the new &#8220;across&#8221; loop variant, which uses an external cursor and maintains this automatically, so that one does not need to worry about such issues any more.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on A couple of loop examples by Bertrand Meyer's technology blog » Blog Archive » Just another day at the office</title>
		<link>http://bertrandmeyer.com/2010/01/28/a-couple-of-loop-examples/comment-page-1/#comment-143</link>
		<dc:creator>Bertrand Meyer's technology blog » Blog Archive » Just another day at the office</dc:creator>
		<pubDate>Sat, 06 Feb 2010 18:57:10 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=1025#comment-143</guid>
		<description>[...] about this point in a comment to this post. The new across loop variant described in  two later postings uses external cursors and manages them automatically, so this business of maintaining the cursor [...]</description>
		<content:encoded><![CDATA[<p>[...] about this point in a comment to this post. The new across loop variant described in  two later postings uses external cursors and manages them automatically, so this business of maintaining the cursor [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on More expressive loops for Eiffel by Bertrand Meyer's technology blog » Blog Archive » Just another day at the office</title>
		<link>http://bertrandmeyer.com/2010/01/26/more-expressive-loops-for-eiffel/comment-page-1/#comment-142</link>
		<dc:creator>Bertrand Meyer's technology blog » Blog Archive » Just another day at the office</dc:creator>
		<pubDate>Sat, 06 Feb 2010 18:56:10 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=990#comment-142</guid>
		<description>[...] Thanks to Ian Warrington for raising that point. The new across loop variant described in  two later postings uses external cursors and manages them automatically, so this business of maintaining the [...]</description>
		<content:encoded><![CDATA[<p>[...] Thanks to Ian Warrington for raising that point. The new across loop variant described in  two later postings uses external cursors and manages them automatically, so this business of maintaining the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Reflexivity, and other pillars of civilization by barrkel</title>
		<link>http://bertrandmeyer.com/2010/02/06/reflexivity-and-other-pillars-of-civilization/comment-page-1/#comment-141</link>
		<dc:creator>barrkel</dc:creator>
		<pubDate>Sat, 06 Feb 2010 17:58:47 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=1054#comment-141</guid>
		<description>ISTM that either three-valued logic (i.e. SQL TRUE, FALSE and NULL behaviour) or signalling NaNs are preferable to silent NaNs. Signalling NaNs by default are preferable for practical reasons too; usually a NaN is caused by a programming mistake where an argument to an operation wasn't correctly bounds-checked.

Of course, floating-point numbers are imperfect substitutes for mathematical real-valued numbers - I think REAL is a poor choice of name for the type in a programming language, as it has the potential to mislead the mathematically minded - since many functions on floating-point values that a mathematician would expect to be identity functions will turn out to accumulate imprecision, resulting in similarly surprising x != x.</description>
		<content:encoded><![CDATA[<p>ISTM that either three-valued logic (i.e. SQL TRUE, FALSE and NULL behaviour) or signalling NaNs are preferable to silent NaNs. Signalling NaNs by default are preferable for practical reasons too; usually a NaN is caused by a programming mistake where an argument to an operation wasn&#8217;t correctly bounds-checked.</p>
<p>Of course, floating-point numbers are imperfect substitutes for mathematical real-valued numbers &#8211; I think REAL is a poor choice of name for the type in a programming language, as it has the potential to mislead the mathematically minded &#8211; since many functions on floating-point values that a mathematician would expect to be identity functions will turn out to accumulate imprecision, resulting in similarly surprising x != x.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Just another day at the office by Ian Warrington</title>
		<link>http://bertrandmeyer.com/2010/01/15/just-another-day-at-the-office/comment-page-1/#comment-135</link>
		<dc:creator>Ian Warrington</dc:creator>
		<pubDate>Sat, 06 Feb 2010 00:33:33 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=899#comment-135</guid>
		<description>Hi Bertrand, just wondering about your definition of is_equal with respect to command / query separation? By advancing through the collections, the value of "item" is changing for the current object as well as "other". Would you need to restore the original values of "item" so as to not produce any abstract side effects?

Kind regards,

Ian</description>
		<content:encoded><![CDATA[<p>Hi Bertrand, just wondering about your definition of is_equal with respect to command / query separation? By advancing through the collections, the value of &#8220;item&#8221; is changing for the current object as well as &#8220;other&#8221;. Would you need to restore the original values of &#8220;item&#8221; so as to not produce any abstract side effects?</p>
<p>Kind regards,</p>
<p>Ian</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on More expressive loops for Eiffel by bmeyer</title>
		<link>http://bertrandmeyer.com/2010/01/26/more-expressive-loops-for-eiffel/comment-page-1/#comment-134</link>
		<dc:creator>bmeyer</dc:creator>
		<pubDate>Thu, 04 Feb 2010 20:59:37 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=990#comment-134</guid>
		<description>The `across' variant is formally defined by an "unfolded form" that uses the `from' variant. In the case of a void structure it will produce the same effect, a "call on void target" exception.

In void-safe mode the compiler will reject the code (although I haven't checked this yet on an actual example).</description>
		<content:encoded><![CDATA[<p>The `across&#8217; variant is formally defined by an &#8220;unfolded form&#8221; that uses the `from&#8217; variant. In the case of a void structure it will produce the same effect, a &#8220;call on void target&#8221; exception.</p>
<p>In void-safe mode the compiler will reject the code (although I haven&#8217;t checked this yet on an actual example).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The theory and calculus of aliasing by SniX</title>
		<link>http://bertrandmeyer.com/2010/01/21/the-theory-and-calculus-of-aliasing/comment-page-1/#comment-133</link>
		<dc:creator>SniX</dc:creator>
		<pubDate>Thu, 04 Feb 2010 20:45:39 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=935#comment-133</guid>
		<description>Hi Bertrand,

is the calculus able to determine if and when an object is not aliased anymore?

Also, which typesetting system do you use for your publications? Latex? I find the results awesome.

S.</description>
		<content:encoded><![CDATA[<p>Hi Bertrand,</p>
<p>is the calculus able to determine if and when an object is not aliased anymore?</p>
<p>Also, which typesetting system do you use for your publications? Latex? I find the results awesome.</p>
<p>S.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on More expressive loops for Eiffel by Peter Gummer</title>
		<link>http://bertrandmeyer.com/2010/01/26/more-expressive-loops-for-eiffel/comment-page-1/#comment-132</link>
		<dc:creator>Peter Gummer</dc:creator>
		<pubDate>Wed, 03 Feb 2010 22:06:40 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=990#comment-132</guid>
		<description>What happens if the structure is Void? Take your first example:

  across s as c loop print (c.item) end

If 's' is declared to be of a detachable type, and if it actually is Void at run time, does this 'across' loop raise a Void-target call exception? (This is what C# does if the structure supplied to a 'foreach' loop is null. I'm fixing one such NullReferenceException bug right now that has gone undetected for months in our C# code.) Or does 'across' recognise that the structure is Void, and treat it the same as if it were empty, performing zero iterations of the loop? (This is what I wish C# 'foreach' loops did; I wish it frequently, unfortunately.)

Or would the Void-safe Eiffel compiler reject the above code if 's' is detachable?</description>
		<content:encoded><![CDATA[<p>What happens if the structure is Void? Take your first example:</p>
<p>  across s as c loop print (c.item) end</p>
<p>If &#8217;s&#8217; is declared to be of a detachable type, and if it actually is Void at run time, does this &#8216;across&#8217; loop raise a Void-target call exception? (This is what C# does if the structure supplied to a &#8216;foreach&#8217; loop is null. I&#8217;m fixing one such NullReferenceException bug right now that has gone undetected for months in our C# code.) Or does &#8216;across&#8217; recognise that the structure is Void, and treat it the same as if it were empty, performing zero iterations of the loop? (This is what I wish C# &#8216;foreach&#8217; loops did; I wish it frequently, unfortunately.)</p>
<p>Or would the Void-safe Eiffel compiler reject the above code if &#8217;s&#8217; is detachable?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on More expressive loops for Eiffel by bmeyer</title>
		<link>http://bertrandmeyer.com/2010/01/26/more-expressive-loops-for-eiffel/comment-page-1/#comment-131</link>
		<dc:creator>bmeyer</dc:creator>
		<pubDate>Sun, 31 Jan 2010 22:47:08 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=990#comment-131</guid>
		<description>Both. It is very easy to make the `across...' loop applicable to any class:

- The simplest is to make the class a descendant of one of the existing descendants of the ITERABLE class, such as INDEXABLE (which is for example used as ancestor by all the list classes). Then you have nothing more to do; you get a standard cursor.

- If you want a more specific cursor, make the class a descendant of ITERABLE and write the specific cursor class as a descendant of ITERATION_CURSOR, effecting the queries `item' and `off'. This gives you finer control in case your structure has specific properties that should be accessible through the cursor. As an example, you can look at how this was done for HASH_TABLE in such a way that in a loop

   across my_hash_table as mht loop ... end

you can in a loop body access both mht.item, giving the current item in the hash table, and mht.key, giving its key.</description>
		<content:encoded><![CDATA[<p>Both. It is very easy to make the `across&#8230;&#8217; loop applicable to any class:</p>
<p>- The simplest is to make the class a descendant of one of the existing descendants of the ITERABLE class, such as INDEXABLE (which is for example used as ancestor by all the list classes). Then you have nothing more to do; you get a standard cursor.</p>
<p>- If you want a more specific cursor, make the class a descendant of ITERABLE and write the specific cursor class as a descendant of ITERATION_CURSOR, effecting the queries `item&#8217; and `off&#8217;. This gives you finer control in case your structure has specific properties that should be accessible through the cursor. As an example, you can look at how this was done for HASH_TABLE in such a way that in a loop</p>
<p>   across my_hash_table as mht loop &#8230; end</p>
<p>you can in a loop body access both mht.item, giving the current item in the hash table, and mht.key, giving its key.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on More expressive loops for Eiffel by Patrick Schoenbach</title>
		<link>http://bertrandmeyer.com/2010/01/26/more-expressive-loops-for-eiffel/comment-page-1/#comment-129</link>
		<dc:creator>Patrick Schoenbach</dc:creator>
		<pubDate>Sun, 31 Jan 2010 22:21:53 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=990#comment-129</guid>
		<description>Will these new loop constructs work with the standard EiffelBase containers only or will it be possible as well to make them work with any custom data structure?</description>
		<content:encoded><![CDATA[<p>Will these new loop constructs work with the standard EiffelBase containers only or will it be possible as well to make them work with any custom data structure?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The theory and calculus of aliasing by bmeyer</title>
		<link>http://bertrandmeyer.com/2010/01/21/the-theory-and-calculus-of-aliasing/comment-page-1/#comment-128</link>
		<dc:creator>bmeyer</dc:creator>
		<pubDate>Sat, 30 Jan 2010 01:00:06 +0000</pubDate>
		<guid isPermaLink="false">http://bertrandmeyer.com/?p=935#comment-128</guid>
		<description>Thanks for the kind comments. Helmut Brandl has already pointed out the problem of routines called through dynamic binding. My comment that inheritance has little effect is too strong, but other than forcing the programmer to write "modifies clauses" there is no other path than taking into account all redeclarations. The next step of the work will take this into account.

I will release my current implementation as open source in a few weeks.</description>
		<content:encoded><![CDATA[<p>Thanks for the kind comments. Helmut Brandl has already pointed out the problem of routines called through dynamic binding. My comment that inheritance has little effect is too strong, but other than forcing the programmer to write &#8220;modifies clauses&#8221; there is no other path than taking into account all redeclarations. The next step of the work will take this into account.</p>
<p>I will release my current implementation as open source in a few weeks.</p>
]]></content:encoded>
	</item>
</channel>
</rss><!-- Dynamic page generated in 0.544 seconds. --><!-- Cached page generated by WP-Super-Cache on 2010-09-03 15:48:29 -->
