M
Michael Riepe
Guest
Hi everybody,
this is something for the language experts out there.
I know that it's legal to override implicitly declared operators (from a
type declaration) with an explicit declaration, but is it also allowed
to override an implicit _alias_ declaration of such an operator (as
created by an alias declaration for the type)?
That is, may I write something like this?
package strange is
alias mytype is bit;
-- this implicitly declares, among others:
-- alias "and" is std.standard."and" [ bit, bit return bit ];
-- and now, declare a homograph:
function "and" (l, r : mytype) return mytype;
end strange;
The standard isn't very clear about that, it just mentions that "an
implicit declaration of a predefined operation" is overridden by a
second homograph in the same declarative region.
Thanks in advance,
--
Michael "Tired" Riepe <Michael.Riepe@stud.uni-hannover.de>
"All I wanna do is have a little fun before I die"
this is something for the language experts out there.
I know that it's legal to override implicitly declared operators (from a
type declaration) with an explicit declaration, but is it also allowed
to override an implicit _alias_ declaration of such an operator (as
created by an alias declaration for the type)?
That is, may I write something like this?
package strange is
alias mytype is bit;
-- this implicitly declares, among others:
-- alias "and" is std.standard."and" [ bit, bit return bit ];
-- and now, declare a homograph:
function "and" (l, r : mytype) return mytype;
end strange;
The standard isn't very clear about that, it just mentions that "an
implicit declaration of a predefined operation" is overridden by a
second homograph in the same declarative region.
Thanks in advance,
--
Michael "Tired" Riepe <Michael.Riepe@stud.uni-hannover.de>
"All I wanna do is have a little fun before I die"