[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Java operator overloading
Hi Feng,
It is somewhat related, but not completely. We want to do operator
overloading as in C++, so that, for example, an infix "a + b" will invoke
a particular method in "a"'s class that understands "+" given an argument
of "b"'s class. This is the opposite of "boxing" which converts
primitives into objects. We want to allow user-defined objects to
overload builtin operators.
For our applications it would be convenient to define new sorts of
integers, fixed point, and floating point numbers and use infix operators
on them. I think Java Grande might be looking at that sort of thing, but I
couldn't find an implementation.
Thanks,
Maya
On Wed, 3 Mar 2004, Feng Qian wrote:
> It is related to generic types or parameterized types? I think java 1.5
> will have such things.
>
> Cheers,
> Feng
>
> Maya Gokhale wrote:
>
> >Does anyone know of an operator overloading implementation for Java? We're
> >interested in acquiring (or writing) such a package. It seems fairly
> >straightforward to do using polyglot, but we haven't found one already
> >written yet.
> >
> >Thanks,
> >
> >Maya
> >
> >
> >
>
--
------------------------------
Maya B. Gokhale, maya@lanl.gov
nis-www.lanl.gov/~maya
505-665-9095
------------------------------