cr88192 <cr88192@[EMAIL PROTECTED]
> wrote:
>
> why exactly is it that . and -> were originally made to be separate
> operators anyways?...
Because back in the old days, there was no requirement that the left
operand have a structure or pointer to structure type. You could (and
people did!) use . or -> on integers, arrays, or whatever. Since the
operators do different things, they had to be distinct so the user could
specify which operation was desired. Now that the left operand is
restricted, there's no technical reason for having distinct operators.
Given that they already exist, however, there doesn't seem to be any
particular benefit to merging them and there would be real costs
involved to do so.
> what exactly is the cost of, say, a compiler implementor being lazy and
> treating both cases as equivalent? (well, apart from maybe the risk of a
> user writing code which will promptly break if used on a more
> standards-conformant compiler...).
Although you describe it as being "lazy", I can't imagine that
implementing one operator that can do either of two things is any less
work than implementing two operators each of which only does one thing.
-- Larry Jones
Years from now when I'm successful and happy, ...and he's in
prison... I hope I'm not too mature to gloat. -- Calvin


|