Talk:Covariance-aware assertions

Revision as of 01:46, 23 April 2007 by Peter gummer (Talk | contribs)

--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.