🎉 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!

Tangent: Phrase Refactor, Part 1

Published February 25, 2009
Advertisement
I have basic phrases working again with the new syntax:

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.
Previous Entry FLU!
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement