Re: Operator Overloading

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri, 17 Aug 2007 10:07:11 -0600 (MDT)

Bruce,

I'm afraid you can't do something like this. You would instead need to
define a function, like "a_plus_b", that would do the appropriate thing
depending on the type of "a" and "b", or the value of the "special"
attribute you mentioned.

--Mary

On Fri, 17 Aug 2007, Lunde, Bruce N CIV NAVOCEANO, NP1 wrote:

> Hello,
>
> Does NCL allow "overloading" of operations such as "+", so that it can
> be redefined for special data objects other than the normal arrays or
> strings ? This could be useful if one defined a_at_type="special", so
> that "a + b" is different depending if their "type" attributes are
> "special".
>
> Thanks, Bruce
>
> =====
> Bruce Lunde
> Bruce.Lunde_at_navy.mil
> 228-688-5843
> Code NP1
> Naval Oceanographic Office
> Stennis Space Center, MS
> =====
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Aug 17 2007 - 10:07:11 MDT

This archive was generated by hypermail 2.2.0 : Mon Aug 20 2007 - 09:30:37 MDT