This is the code i'm running: import x10.io.Console; import x10.io.*; import x10.lang.*; import x10.util.*;
public class Test { public static def main(args:Rail[String]) { var s1:String = "aaaa"; var s2:String = "zz"; Console.OUT.println((s1 <= s2)); Console.OUT.println(s1.compareTo(s2)); } } Seems the system has an issue with compiling Java backend, so I was not able to test it on that. What version of x10 are you running? If your code gives back the correct answer, then it probably could be issues with the x10 on the system. Thanks, Han Dong h...@umbc.edu University of Maryland '10 On Wed, Jun 23, 2010 at 6:34 PM, Yoav Zibin <yoav.zi...@gmail.com> wrote: > according to the output (false and -2) then you're probably using these > strings: > > var s1:String = "aaaa"; > var s2:String = "aa"; > > and not: > var s1:String = "aaaa"; > var s2:String = "zz"; > > please double check. > > > On Wed, Jun 23, 2010 at 6:29 PM, Yoav Zibin <yoav.zi...@gmail.com> wrote: > > > It works for me both in Java and in C++. > > Can you send your test file? > > > > > > y...@yoavlaptop ~/test > > $ x10c Hello.x10 > > > > y...@yoavlaptop ~/test > > $ x10 Hello > > true > > -25 > > > > y...@yoavlaptop ~/test > > $ x10c++ Hello.x10 > > > > y...@yoavlaptop ~/test > > $ x10 Hello > > true > > -25 > > > > > > > > > > On Wed, Jun 23, 2010 at 5:39 PM, Han Dong <saviola7...@gmail.com> wrote: > > > >> Hi all, > >> > >> I have a question regarding the String compareTo function and the "<=" > >> function in x10. I have this test code: > >> > >> var s1:String = "aaaa"; > >> var s2:String = "zz"; > >> > >> Console.OUT.println((s1 <= s2)); > >> Console.OUT.println(s1.compareTo(s2)); > >> > >> which gave me these outputs: > >> > >> : false > >> : 2 > >> > >> For the first comparison test utilizing the "<=" function, it states in > >> the > >> API that it compares if the first string is before the second string in > >> dictionary order, however the output is 'false' which means "aaaa" is > not > >> before "zz"? > >> > >> For the second comparison test utilizing the "compareTo" function, since > >> it > >> gave an output of positive 2, this means that s1 follows s2. However, in > >> my > >> past experiences with compareTo functions, it should be giving me a > >> negative > >> integer since "aaaa" should be before "zz"? > >> > >> I am running this code on my school's intel nehalem blades, it has > >> x10-2.0.3 > >> on them. Compiling, i use: > >> > >> x10-2.0.3/bin/x10c++ test.x10 > >> mpiexec -n 1 ./a.out > >> > >> > >> Thanks, > >> > >> Han Dong > >> h...@umbc.edu > >> University of Maryland '10 > >> > >> > ------------------------------------------------------------------------------ > >> ThinkGeek and WIRED's GeekDad team up for the Ultimate > >> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > >> lucky parental unit. See the prize list and enter to win: > >> http://p.sf.net/sfu/thinkgeek-promo > >> _______________________________________________ > >> X10-users mailing list > >> X10-users@lists.sourceforge.net > >> https://lists.sourceforge.net/lists/listinfo/x10-users > >> > > > > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > X10-users mailing list > X10-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/x10-users > ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ X10-users mailing list X10-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/x10-users