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 main()=>void{ foo(); bar "moo."; baz ("bleat.",6); phrase "bleat." 42;}
I'm not sure I did much to make the code more maintainable. There is less copy/paste for sure, but it's a little more convoluted and there's still enough to cause a problem. Theoretically more things should work now, like infix phrases, delegate phrases and some other goodies. But if I start down that bug strewn road I might not get to sleep.
Next bit of work will be a (mildly) rigorous set of tests to make sure all of the functionality is there and to perhaps help demonstrate to curious programmers what phrases are, how they're structured and what they look like. Though more likely they'll end up being a bar graph of how much work I have yet to do.