public static foo() => void{ print "foo.";}public static bar(string s) => void{ print s;}public static baz(string s, int i) => void{ print s i;}public static phrase(string s) (int i) => void{ print s i;}public static how now brown cow => void{ print "MOO!";}public static test (int lhs) times (int rhs) => int{ return lhs * rhs; }public static (int lhs) op (int rhs) => int{ return lhs * rhs; }public static (string lhs) * (string rhs) => string{ return lhs + rhs; }public static (string lhs) ++ (string rhs) => string{ return lhs + rhs; }public static (int x) a b => int{ return x+5; }public static delegate voidDel() => void;public static delegate (string lhs) opDel (string rhs) => string;public static delegate what now brown cow => void;public static delegate cowDelegate cow => void;public static main()=>void{ foo(); bar "moo."; baz ("bleat.",6); phrase "bleat." 42; how now brown cow; print test 4 times 6; print 2 op 3; print "moose:" * " umm. moose."; print "moose:" ++ " umm. moose."; //print 5 a b; // bug #37 voidDel = foo; voidDel(); opDel = +; print "moo" opDel "cow"; opDel = ++; print "bleat" opDel "sheep"; what = how; what now brown cow; cowDelegate = how now brown; cowDelegate cow; voidDel = ()=>void{ print "llllama."; }; voidDel();}
🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
Not much time for hobby this weekend. I managed to setup some delegates and make sure they work like they're supposed to. The example code, which includes infix delegates and a quick example of the partial application built into the language:
Previous Entry
Tangent: Method Tests Part 1
Next Entry
Tangent: Method Tests Part 3
Advertisement
Latest Entries
And so it goes...
1691 views
Tangent, now with usable error messages!
1849 views
Back to work!
1763 views
Tangent: Haitus
1742 views
Tangent: Syntax reworking
1504 views
Tangent: Adverbs
1383 views
Tangent: Pattern Matching, Part 1
1596 views
Tangent: Pattern Matching, Part 1
1448 views
Tangent: Generic Method Bodies, Part 2
1605 views
Tangent: Generic Method Bodies, Part 1
1454 views
Advertisement