-Subproject commit 66353d14748fdb971a9414370918edaf12cb0245
+Subproject commit 9c066c017f339b4a00b0cd1beda732bd49194aaa
-fun<~A~> void test(A a) { <<<a>>>; }
+fun void test<~A~>(A a) { <<<a>>>; }
1 => test;
1.3 => test;
test(1);
-function void test() { <<<"member function.">>>; }
+fun void test() { <<<"member function.">>>; }
class C {
typedef void func_t();
// typedef static void s_func_t();
func_t func_p;
// static fun c_t s_func_p;
// static s_func_t s_ptr;
- function void test() { <<<"member function.">>>; }
- function void test2() { <<<"member function variant.">>>; }
-// fun static void s_test() { <<<"member function.">>>; }
+ fun void test() { <<<"member function.">>>; }
+ fun void test2() { <<<"member function variant.">>>; }
+// fun static void s_test() { <<<"member fun.">>>; }
// test @=> func_p;
// test @=> s_ptr;
class C
{
- function void test() {
+ fun void test() {
<<<"here">>>;
samp => now;
<<<"and now">>>;
-function float testf(){ return 1.1; }
-function float testf(float f){ return f; }
+fun float testf(){ return 1.1; }
+fun float testf(float f){ return f; }
<<<testf()>>>;
<<<testf(1.4)>>>;
typedef void func_t();
func_t func_p;
-function void test1() { <<<"test1">>>; }
-function void test2() { <<<"test2">>>; }
+fun void test1() { <<<"test1">>>; }
+fun void test2() { <<<"test2">>>; }
test1 @=> func_p;
func_p();
func_p();
-// define a function pointer type
+// define a fun pointer type
typedef void Test()
-// define a few functions
-function void test1(){ <<<"test">>>; };
-function void test2(){ <<<"another test">>>; };
-function void test3(){ <<<"yet another test">>>; };
+// define a few funs
+fun void test1(){ <<<"test">>>; };
+fun void test2(){ <<<"another test">>>; };
+fun void test3(){ <<<"yet another test">>>; };
-// create a function pointer instance
+// create a fun pointer instance
Test test;
-// assign it a function
+// assign it a fun
test1 @=> test;
// test it
test();
class C {
- function<~a~> void test(a var){ <<<var>>>; }
+ fun void test<~a~>(a var){ <<<var>>>; }
class D { int i;}
}
Vec4 w;
Object o;
- function int m_i() { return i; }
- function float m_f() { return f; }
- function complex m_c() { return c; }
- function Vec3 m_v() { return v; }
- function Vec4 m_w() { return w; }
- function Object m_o() { return o; }
+ fun int m_i() { return i; }
+ fun float m_f() { return f; }
+ fun complex m_c() { return c; }
+ fun Vec3 m_v() { return v; }
+ fun Vec4 m_w() { return w; }
+ fun Object m_o() { return o; }
}
C c;
// read members
<<< c.i, c.c, c.f, c.v, c.w, c.o >>>;
-// call function members
+// call fun members
<<< c.m_i(), " ", c.m_f(), " ", c.m_c(), " ",
c.m_v(), " ", c.m_w(), " ", c.m_o()>>>;
class C
{
- function float testf() {
+ fun float testf() {
return 1.1;
}
- function float testf(float f) {
+ fun float testf(float f) {
return f;
}
}
class C
{
typedef void Test();
- function void test1(){};
+ fun void test1(){};
Test test0;
<<<test1 @=> test0>>>;
}
class Sine extends SinOsc
{
- function float freq(float f) { (2 * f) => (this $ SinOsc).freq; }
+ fun float freq(float f) { (2 * f) => (this $ SinOsc).freq; }
}
Sine s => dac;
class C
{
- function void test(int i) {
+ fun void test(int i) {
<<<"here => ", i>>>;
samp => now;
<<<"and now">>>;
static Vec4 w;
static Object o;
- function int m_i() { return i; }
- function float m_f() { return f; }
- function complex m_c() { return c; }
- function Vec3 m_v() { return v; }
- function Vec4 m_w() { return w; }
- function Object m_o() { return o; }
+ fun int m_i() { return i; }
+ fun float m_f() { return f; }
+ fun complex m_c() { return c; }
+ fun Vec3 m_v() { return v; }
+ fun Vec4 m_w() { return w; }
+ fun Object m_o() { return o; }
fun static int _i() { return i; }
fun static float _f() { return f; }
// read members
<<< C.i, C.c, C.f, C.v, C.w, C.o >>>;
-// call function members
+// call fun members
<<< C._i(), " ", C._f(), " ", C._c(), " ", C._v(), " ", C._w(), " ", C._o()>>>;
// write members
int i;
-function void test(int i) {
+fun void test(int i) {
switch(i) {
case 1:
<<<"'i' is 1">>>;
-function<~A~> void test (A var){ <<< var>>>; }
-function<~A,B~> void test (A var, B var2){ <<< var>>>; }
+fun void test<~A~> (A var){ <<< var>>>; }
+fun void test<~A,B~> (A var, B var2){ <<< var>>>; }
test<~int~>(1);
test<~float, float~>(3, 1.4);
class C {
- fun<~A~> int test(A a) { <<<" A ", a>>>; }
- fun<~A~> int test(A a, int i) { <<<" ", a >>>; }
- fun<~A~> int test(A a, int i, int j) { <<<a>>>; }
+ fun int test<~A~>(A a) { <<<" A ", a>>>; }
+ fun int test<~A~>(A a, int i) { <<<" ", a >>>; }
+ fun int test<~A~>(A a, int i, int j) { <<<a>>>; }
}
class D extends C {
- fun<~A~> int test(A a, int i) { <<<this, " extent ", a, __func__>>>; }
+ fun int test<~A~>(A a, int i) { <<<this, " extent ", a, __func__>>>; }
}
class E extends D {
- fun<~A~> int test(A a, int i) { <<<this, " Extent ", a, __func__>>>; }
+ fun int test<~A~>(A a, int i) { <<<this, " Extent ", a, __func__>>>; }
}
-function <~A,B~> void test(A a, B b){<<<a, ", ", b>>>;}
+fun void test<~A,B~>(A a, B b){<<<a, ", ", b>>>;}
test(1, 2.1);
test(1.1, 2.1);
test(1.2, 2);
-fun<~A~> void test(...) {
+fun void test<~A~>(...) {
vararg.start;
<<<vararg.i>>>;
vararg.end;
class Tester
{
- function<~A~> int assert_equal(string description, A a, A b){ if(a == b) return 0; return 1; }
- function<~A~> int assert_not_equal(string description, A a, A b){ if(a != b) return 0; return 1; }
+ fun int assert<~A~>_equal(string description, A a, A b){ if(a == b) return 0; return 1; }
+ fun int assert<~A~>_not_equal(string description, A a, A b){ if(a != b) return 0; return 1; }
}
Tester t;
{
//! has an int
int i;
- //! a function
- function void test() {}
+ //! a fun
+ fun void test() {}
//! operator
operator => void(C c, C d){
<<<c, " ", d>>>;
-function void test(){}
+fun void test(){}
test([1], 2.3);
// [contains] primitive types cannot be used as reference
-function void test(int @i){}
+fun void test(int @i){}
// [contains] this is reserved
-function void test(int this){}
+fun void test(int this){}
}
class D extends C {
- function void test(){}
+ fun void test(){}
}
// [contains] must be defined with empty
-function int[] my_func(int i[2]){}
+fun int[] my_func(int i[2]){}
// [contains] already declared
-function void test(int i, int i){}
+fun void test(int i, int i){}
// [contains] unknown type
- function void my_func(unknown_type unknown_arg){}
+ fun void my_func(unknown_type unknown_arg){}
// [contains] in function:
-function void test() { <<<b>>>; }
+fun void test() { <<<b>>>; }
// [contains] unknown type
-function void test() { skfuv sd; }
+fun void test() { skfuv sd; }
-// [contains] argument type(s) do not match for function
-function void test(){}
-function void test(int i[], int j[]){}
+// [contains] argument type(s) do not match for fun
+fun void test(){}
+fun void test(int i[], int j[]){}
test(1,2);
// [contains] must be defined with empty
- function int[1] my_func(int i[]){}
+ fun int[1] my_func(int i[]){}
// [contains] unknown type
- function unknwon_type my_function(){}
+ fun unknwon_type my_function(){}
// [contains] cannot declare variables of size
- function void test(void v){}
+ fun void test(void v){}
// [contains]
- function void test()
+ fun void test()
{
- function void nested(){}
+ fun void nested(){}
}
// [contains] primitive types cannot be used as reference
-function int@ test(){}
+fun int@ test(){}
// [contains] is already used by another value
int i;
-function void i(){}
+fun void i(){}
// [contains] global function 'test' already defined for those arguments
-function void test(){}
-function void test(){}
+fun void test(){}
+fun void test(){}
// [contains] invalid return type
-function void test() { return 1; }
+fun void test() { return 1; }
}
class D extends C {
- function int test() {}
+ fun int test() {}
}
class D extends C
{
- function void test() {}
+ fun void test() {}
}
C c;
class D extends C
{
- function void test() {}
+ fun void test() {}
}
// [contains] but cannot override
class C
{
- function void test() {}
+ fun void test() {}
}
class D extends C
// [contains] can only be used at class scope
-typedef static void my_function(){}
+typedef static void my_fun(){}
// [contains] unknown type
- typedef unknown_type my_function(){}
+ typedef unknown_type my_fun(){}
Test test;
}
-function void test(){}
+fun void test(){}
C c;
test @=> c.test;
typedef void Test();
Test test;
class D {
- function void test(){}
+ fun void test(){}
}
D d;
}
class D {
- function void test(){}
+ fun void test(){}
}
C c;
// [contains] no match found
-function void test(int i){}
-function void test(float f){}
+fun void test(int i){}
+fun void test(float f){}
typedef void Test();
Test t;
// [contains]
-function<~A,B~> void test(){}
+fun void test<~A,B~>(){}
test();
// [contains] arguments do not match for template call
-function<~A~> void test(){ <<<"func">>>;}
-function<~A~> void test(int i){<<<"other func">>>;}
+fun void test<~A~>(){ <<<"func">>>;}
+fun void test<~A~>(int i){<<<"other func">>>;}
test<~int, float, int~>();
//test<~int~>();
// [contains] arguments do not match for template call
class C {
- function<~A~> void test(float f) {}
- function<~A~> void test() {}
+ fun void test<~A~>(float f) {}
+ fun void test<~A~>() {}
}
C c;
//c.test<~int~>();
// [contains] invalid expression for function call
-function<~A~> void test(A a){}
+fun void test<~A~>(A a){}
(maybe ? test : test)(1);
// [contains] unknown type
-function<~A~> void my_function() { <<<"test">>>; }
+fun void my_function<~A~>() { <<<"test">>>; }
my_function<~unknown_type~>();
// [contains] unknown type
-function void test(B->C a){}
+fun void test(B->C a){}
-<<<"test builtin variadic function">>>;
+<<<"test builtin variadic fun">>>;
Variadic v;
"iiii" => string format;
<<<v, " ", format $ Object>>>;
-function void test() {
+fun void test() {
// <<<1>>>;
//spork \{<<<2>>>;}();
}
-function void test(int i[]){}
+fun void test(int i[]){}
-function void print_array(int a[]){
+fun void print_array(int a[]){
for(int i; i < a.size(); i++)
<<<a[i]>>>;
}
{
typedef void Test();
Test test;
- function void func(){}
+ fun void func(){}
}
C c;
c.func @=> c.test;
-function float test() {}
-function float test(int i) {}
-function float test(float f) {}
-function float test(complex c) {}
-function float test(Vec3 v) {}
-function float test(Vec4 w) {}
-
-function complex ctest(){}
-function Vec3 vtest(){}
-function Vec4 wtest(){}
+fun float test() {}
+fun float test(int i) {}
+fun float test(float f) {}
+fun float test(complex c) {}
+fun float test(Vec3 v) {}
+fun float test(Vec4 w) {}
+
+fun complex ctest(){}
+fun Vec3 vtest(){}
+fun Vec4 wtest(){}
ctest();
vtest();
wtest();
class C
{
- function float test() {}
- function float test(int i) {}
- function float test(float f) {}
- function float test(complex c) {}
- function float test(Vec3 v) {}
- function float test(Vec4 w) {}
+ fun float test() {}
+ fun float test(int i) {}
+ fun float test(float f) {}
+ fun float test(complex c) {}
+ fun float test(Vec3 v) {}
+ fun float test(Vec4 w) {}
fun static float s_test() {}
fun static float s_test(int i) {}
fun A test() {
<<<"lol">>>;
}
- fun<~C~> void test2(C c) {
+ fun void test2<~C~>(C c) {
<<<c>>>;
}
}
<<<"test">>>;
<<< 2.3 $ int >>>;
1 => float f;
-function void test(float f){}
+fun void test(float f){}
1 => test;
class Sine extends SinOsc
{
- function int freq(float f) {
+ fun int freq(float f) {
(2 * f) => (this $ SinOsc).freq;
}
}
-function void test() { <<<"test">>>; return; <<<"this won't print. ever.">>>; }
+fun void test() { <<<"test">>>; return; <<<"this won't print. ever.">>>; }
test();
-function complex testc() {};
-function Vec3 testv3() {};
-function Vec4 testv4() {};
+fun complex testc() {};
+fun Vec3 testv3() {};
+fun Vec4 testv4() {};
testc();
testv3();
testv4();
-function void test(int i){}
-function int test(){}
+fun void test(int i){}
+fun int test(){}
<<<test(1)>>>;
<<<test()>>>;
{
operator => void(C c, int i){<<<c, " ", i>>>;}
// this => this;
-//function void test_op(C c){ this => c; }
+//fun void test_op(C c){ this => c; }
this => int i;
}
C c;
-function Object test(){ Object o; <<<o>>>; return new Object; }
+fun Object test(){ Object o; <<<o>>>; return new Object; }
test();
typedef void Test();
-function void t(){<<<"lol">>>;}
+fun void t(){<<<"lol">>>;}
t @=> Test test;
test();
typedef void Test();
-function void t0(){}
+fun void t0(){}
t0 @=> Test test;
test();
-function void test() { complex c; c; Vec3 v; v; Vec4 w; w; }
+fun void test() { complex c; c; Vec3 v; v; Vec4 w; w; }
test();
// define a simple variable: 'i'.
int i;
-// define a functions that returns 1 if 'i' is non zero, and 0 othervise.
-function int test() { return i ? 1 : 0; }
+// define a funs that returns 1 if 'i' is non zero, and 0 othervise.
+fun int test() { return i ? 1 : 0; }
<<<test()>>>;
1 => i;
<<<test()>>>;
-function void test(int i, int j){}
+fun void test(int i, int j){}
spork test(1,2);
-function void test() {
+fun void test() {
spork { <<<2>>>; };
}
//spork { <<<1>>>; };
class C
{
- function void test(int i){
+ fun void test(int i){
<<<i>>>;
spork {
<<<"test2">>>;
class C
{
- function C test() {
+ fun C test() {
return this;
}
}
class C
{
- function void test() {
+ fun void test() {
<<<this>>>;
}
}
-// just to check uncalled function to not push the stack
+// just to check uncalled fun to not push the stack
class C { fun void test(){} fun static void stest() {}}
C c;