Difference between revisions of "Talk:Covariance-aware assertions"

 
Line 1: Line 1:
 
--[[User:Ericb|Ericb]] 09:17, 23 April 2007 (CEST): I raised this issue at the last ECMA meeting. I suggested using <eiffel>implies</eiffel> instead of <eiffel>and then</eiffel>. But no decision was made.
 
--[[User:Ericb|Ericb]] 09:17, 23 April 2007 (CEST): I raised this issue at the last ECMA meeting. I suggested using <eiffel>implies</eiffel> instead of <eiffel>and then</eiffel>. But no decision was made.
 +
 +
--[[User:Peter gummer|Peter gummer]] 11:46, 23 April 2007 (CEST) This is a digression (sorry), but reading this article I'm left with the feeling that ECMA's object test syntax runs ''contrary'' to Eiffel's aim of being legible to non-propeller-heads. I may not be be the archetypal propeller-head, but I found the object test syntax impeded my comprehension of the article.
 +
 +
<e>
 +
    ({y: STRING} x) and then (True)
 +
</e>
 +
 +
In order to comprehend this, I have to translate it into something like, "<e>x</e> is a <e>STRING</e> and then <e>True</e>." I would be much more comfortable if Eiffel's object test looked like this:
 +
 +
<e>
 +
    x is {STRING} and then True
 +
</e>
 +
 +
Note that I haven't declared the <e>y</e> variable, because the variable is unused in the assertion. There is an example later in the article, however, where the full object test syntax would be needed:
 +
 +
<e>
 +
      if x is {y: STRING} then
 +
        -- Do something with y
 +
</e>
 +
 +
My proposed syntax is more readable at the cost of being a bit more verbose; but because the variable declaration is optional, sometimes it's just as concise. The <e>is</e> keyword, just when we thought we'd seen the end of it, makes a small come-back; <e>inherit</e> might be ok instead, to be parsimonious with keywords, although it would be less legible and concise.

Revision as of 00:46, 23 April 2007

--Ericb 09:17, 23 April 2007 (CEST): I raised this issue at the last ECMA meeting. I suggested using implies instead of and then. But no decision was made.

--Peter gummer 11:46, 23 April 2007 (CEST) This is a digression (sorry), but reading this article I'm left with the feeling that ECMA's object test syntax runs contrary to Eiffel's aim of being legible to non-propeller-heads. I may not be be the archetypal propeller-head, but I found the object test syntax impeded my comprehension of the article.

({y: STRING} x) and then (True)

In order to comprehend this, I have to translate it into something like, "x is a STRING and then True." I would be much more comfortable if Eiffel's object test looked like this:

x is {STRING} and then True

Note that I haven't declared the y variable, because the variable is unused in the assertion. There is an example later in the article, however, where the full object test syntax would be needed:

if x is {y: STRING} then
        -- Do something with y

My proposed syntax is more readable at the cost of being a bit more verbose; but because the variable declaration is optional, sometimes it's just as concise. The is keyword, just when we thought we'd seen the end of it, makes a small come-back; inherit might be ok instead, to be parsimonious with keywords, although it would be less legible and concise.