Tangent: Using

Published June 10, 2009
Advertisement
After exceptions work, the next step is the using block. The syntax is slightly different from C#. You can't have two elements in a using block (I forgot/didn't know you could even do that). And you can't just put a single expression after the using bit. Only the actual block, or another using segment. I was lazy and didn't implement the null check in the generated code (bug #77), so don't using something and then set it to null or fubar the initialization.

Probably now I'll go for a little release to get basic Dictionary importing, exceptions and using available (even if no useful .NET disposable objects are available yet...). Then it's time for bulldozer refactoring. The organization of the code is absolute trash, even without considering all the places where it's just architected oddly.

[edit: and there you go, version 0.29]

Test code of the day:

public class foo{	public    Dispose()=>void{		print "disposing...\r\n";	}		public virtual    Moo()=>void{		print "moo.\r\n";	}	}public class bar:foo{	public    Moo()=>void{		print "MOO!\r\n";	}}public static main()=>void{	using( foo x = new foo )	using( foo y = new bar )	{		x.Moo();		y.Moo();	}}		
0 likes 4 comments

Comments

nerd_boy
There you go again, using "\r\n" instead of "\n", trying to break my Tangent GUI thing. :p
June 10, 2009 03:36 PM
Telastyn
Quote:Original post by nerd_boy
There you go again, using "\r\n" instead of "\n", trying to break my Tangent GUI thing. :p


Ah yes, and I need to fix that quirk...
June 10, 2009 09:23 PM
Powell
I've been reading this journal for almost a week now and finally decided to read the whole thing from the beginning; took me 2 days aside from eating sleeping and messing around with python :)

I noticed when you started working on Tangent you kinda gave up Moe
June 13, 2009 01:20 PM
Telastyn
That is true. I rather expected to get frustrated or bored with the project after a week or two and go back to the game. Never really happened.

Thanks for reading!
June 13, 2009 02:42 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement