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

Re: Operator overloading [was: Re: Does my ideal language exist?]



In article <ov8mi8.cr8.ln@localhost>,
	sian@localhost. (Sian Leitch) writes:
> ...
> Operator overloading in Algol 68 is possible (and typical) because
> the context of an operand is `firm' which means that integers cannot
> be `widened' to real or complex numbers, nor converted into arrays
> (`multiples' in Algol 68).

i don't have access to algol68 material any more, but i am pretty sure
that in most contexts automatic widening did happen, while narrowing
had to be explicitely requested by in the source code.  the rational i 
remember was that widening is always safe (in terms of value
preservation), while narrowing (i think that was the term they used)
usually implied a potential inaccuracy or value loss, so for most
narrowing operations there were several operators providing different
types of narrowing (like round / truncate / floor / ceiling)

> ...

-- 

Hartmann Schaffer




References: