liberty-eiffel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Infix "*" in ABSTRACT_STRING


From: Patrick Cloarec
Subject: Re: Infix "*" in ABSTRACT_STRING
Date: Sat, 30 Dec 2023 15:35:01 +0100
User-agent: Mozilla Thunderbird

This too is available in Python :

>>>3*"Ho "+"! Merry Christmas"
'Ho Ho Ho ! Merry Christmas'

In Eiffel that syntax  would implies "*" is a feature of class INTEGER. It is, of course, but only with an INTEGER as parameter.

That makes me write there is no binary operator in Eiffel, an infix is just a syntaxic shortcut for a feature with one parameter. Not to mention the priority between infix'.


Le 30/12/2023 à 13:19, Eric Bezault a écrit :
On 30/12/2023 10:36, Patrick Cloarec wrote:
It is unnatural to me to define a binary operator as the feature of the class of one object. infix is the less intuitive construction offered by Eiffel, in my humble opinion.

They are available in one way or another in many
other languages. For example, in Python:

>>> "Ho "*3+"! Merry Christmas"
'Ho Ho Ho ! Merry Christmas'




reply via email to

[Prev in Thread] Current Thread [Next in Thread]