• entries
359
237
• views
189207

# Tangent: Using

271 views

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();	}}

There you go again, using "\r\n" instead of "\n", trying to break my Tangent GUI thing. :p

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...

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

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.

## Create an account

Register a new account