[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Liberty-eiffel] Why aren'
From: |
Raphael Mack |
Subject: |
Re: [Liberty-eiffel] Why aren' |
Date: |
Sun, 05 Oct 2014 21:14:39 +0000 |
User-agent: |
Internet Messaging Program (IMP) H5 (6.2.1) |
Hi Laurie,
sorry for not answering so long but now find my answer inline...
Zitat von Laurie Moye <address@hidden>:
"infix" [...] operators [...]
'#' is fine,
good to read.
but I would still appreciate knowing what characters are allowed in
free operators.
free operators may consist of these characters:
+-*/\=<>@#|&~
But don't ask me why for example § or ° are not allowed.
My problem is with marix and vector classes which date back to
Eiffel/S days. I think ES implemented polymorphism in a rudimentary
way which made it really easy to define
"class VECTOR[ G -> NUMERIC ]".
When I converted the code to SmallEiffel, I could no longer make the
polymorphism work, and had to expand it all out into classes like
VECTOR_OF_REAL_64.
You mean genericity instead of polymorphism, right?
I am trying to make the polymorphic code work again in LE. Most of
the code only uses the basic arithmetic operators which are declared
in NUMERIC, but for some puropses I need to use features like 'abs'.
These are not declared in NUMERIC, but when I found them in
REAL_GENERAL and INTEGER_GENERAL, I thought I had found a way round
this, but the compiler tells me:
" Fatal Error: The INTEGER_GENERAL type cannot be used here.
Actually this is only a compiler implementation facility."
As all the real and integer classes have, for example, 'abs', why
can't these common features be declared in NUMERIC so that I can use
them in generic code for any numeric class?
Is there a way round this, or am I doomed to have to have classes
like VECTOR_OF_REAL_64?
I guess you are looking for class INTEGRAL - try to use this type as
generic constraint...
Rapha
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Liberty-eiffel] Why aren',
Raphael Mack <=