Update of /cvsroot/nice/Nice/regtest/basic
In directory sc8-pr-cvs1:/tmp/cvs-serv13372/F:/nice/regtest/basic
Modified Files:
arrays.nice higherOrder.nice main.nice syntax.nice
Log Message:
Removed 'fun' from regtest files to test the changes in the parser.
Index: arrays.nice
===================================================================
RCS file: /cvsroot/nice/Nice/regtest/basic/arrays.nice,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** arrays.nice 9 Sep 2002 12:59:27 -0000 1.18
--- arrays.nice 20 Feb 2003 11:16:14 -0000 1.19
***************
*** 92,98 ****
{
println(a.size());
! int[] b = map(a, fun(int i) => i+4);
p(b);
! p(filter(reverse(b), fun(int i)=> i>6));
long[] ls = map(a, id);
--- 92,98 ----
{
println(a.size());
! int[] b = map(a, int i => i+4);
p(b);
! p(filter(reverse(b), int i=> i>6));
long[] ls = map(a, id);
***************
*** 115,126 ****
ss[2] = "e2"; ss[4] = "e4";
p(ss);
! ?String[] ss2 = filter(ss, fun(?String s)=>s!=null);
p(ss2);
! p(map(ss2, fun(?String s)=>{ String str = notNull(s); return str + str; }));
! iter(id(ss), fun(?String s)=>{});
// using an array that is the field of an object
Fields f = new Fields();
! notNull(f.strings).iter(fun(?String s)=>println(s));
Collection<?String> c = ss;
--- 115,126 ----
ss[2] = "e2"; ss[4] = "e4";
p(ss);
! ?String[] ss2 = filter(ss, ?String s=>s!=null);
p(ss2);
! p(map(ss2, ?String s =>{ String str = notNull(s); return str + str; }));
! iter(id(ss), ?String s =>{});
// using an array that is the field of an object
Fields f = new Fields();
! notNull(f.strings).iter(?String s =>println(s));
Collection<?String> c = ss;
***************
*** 144,151 ****
// Literal arrays
String[] ts = [ "A", "B" ];
! ts.iter(fun(String s)=>println(s));
float[] tf = [ 1.5, 2, 3.7 ];
! tf.iter(fun(float f)=>println(f+1));
}
--- 144,151 ----
// Literal arrays
String[] ts = [ "A", "B" ];
! ts.iter( String s =>println(s));
float[] tf = [ 1.5, 2, 3.7 ];
! tf.iter( float f =>println(f+1));
}
Index: higherOrder.nice
===================================================================
RCS file: /cvsroot/nice/Nice/regtest/basic/higherOrder.nice,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** higherOrder.nice 3 May 2002 14:47:04 -0000 1.7
--- higherOrder.nice 20 Feb 2003 11:16:14 -0000 1.8
***************
*** 26,31 ****
{
println(id("ID"));
! println((fun<Any T>(T x)=>x)("LAMBDA"));
! println(apply(fun<Any T>(T x)=>x, "LAMBDA"));
println(apply(nativeToString, "Using native methods as first class values"));
println(apply(id(intIdentity), 42));
--- 26,31 ----
{
println(id("ID"));
! println((<Any T>(T x)=>x)("LAMBDA"));
! println(apply(<Any T>(T x)=>x, "LAMBDA"));
println(apply(nativeToString, "Using native methods as first class values"));
println(apply(id(intIdentity), 42));
Index: main.nice
===================================================================
RCS file: /cvsroot/nice/Nice/regtest/basic/main.nice,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** main.nice 12 Sep 2002 15:51:11 -0000 1.29
--- main.nice 20 Feb 2003 11:16:14 -0000 1.30
***************
*** 67,71 ****
String s1;
! String->void test = fun(String s2) => { s1 = s2; };
}
--- 67,71 ----
String s1;
! String->void test = String s2 => { s1 = s2; };
}
***************
*** 76,82 ****
int j=2;
println("" + j);
! println(""+(fun()=>--j)());
! println(""+(fun()=>j++)());
! println(""+(fun()=>j=2*j)());
}
--- 76,82 ----
int j=2;
println("" + j);
! println(""+(()=>--j)());
! println(""+(()=>j++)());
! println(""+(()=>j=2*j)());
}
Index: syntax.nice
===================================================================
RCS file: /cvsroot/nice/Nice/regtest/basic/syntax.nice,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** syntax.nice 18 Apr 2002 12:39:31 -0000 1.5
--- syntax.nice 20 Feb 2003 11:16:14 -0000 1.6
***************
*** 18,23 ****
// Anonymous functions with empty body
! ()->void f = fun()=> {};
! f = fun()=> { ; };
// [] is the empty array
--- 18,23 ----
// Anonymous functions with empty body
! ()->void f = ()=> {};
! f = ()=> { ; };
// [] is the empty array
|