|
From: | Patrick Cloarec |
Subject: | Re: Infix "*" in ABSTRACT_STRING |
Date: | Sat, 30 Dec 2023 10:36:59 +0100 |
User-agent: | Mozilla Thunderbird |
right ;-) that's definitely not commutative.I just disliske the fact that an infix has to be a feature of the class of the left object.
It seems not natural to me to write "Ho, "*3 while 3*"Ho, " is not possible. I just can't write the scalar value as right parameter.
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.
Le 29/12/2023 à 18:23, Eric Bezault a écrit :
On 29/12/2023 15:25, Patrick Cloarec wrote:I wouldn't use an infix operator for that purpose : it wouldn't be commutativeNote that infix "+" is not commutative either. "Hello " + "World!" is not the same as "World!" + "Hello ". It is nevertheless a convenient operator to use.
[Prev in Thread] | Current Thread | [Next in Thread] |