Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: textToIntevsal(s) and exceptions



On 2015-03-23 20:56:30 +0100, Marco Nehmeier wrote:
> In my opinion we should avoid implicit conversion between bare and
> decorated intervals as well as using inheritance...
> 
> Example.
> 
> two classes:
>     interval
>     decorated_interval (inherited from interval)
> 
> if we have a user function like
> 
>     interval foo(interval x)
> 
> which is only implemented for bare intervals.
> 
> In many languages a call of foo with a decorated interval x_d will
> throw the the decoration d away because x_d is an object of
> decorated_interval which is inherited from interval. Hence x_d is an
> interval x.

I would see the inheritance in the other way round: a bare interval
can be regarded as a particular decorated interval, with the newDec
embedding. Therefore bare_interval would be inherited from
decorated_interval.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)