lzj <li_z...@126.com> wrote on 06/26/2013 08:46:13 AM:
>
> Dear Mr. or Mrs.
> I want to redefine the operator ^ to be the power, eg. 2.0^3.0=8.0.
> Who know how to do it? Please help me.
> Thanks a lot!
>
Hi,
For an example of defining the ^ operator, see Int.x10.
@Native("java", "((#this) ^ (#x))")
@Native("c++", "((x10_int) ((#0) ^ (#1)))")
public native operator this ^ (x:Int): Int;
For non-native classes, just remove the native keyword and @Native
annotations and provide a method body.
--dave
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users