• entries
    359
  • comments
    237
  • views
    188610

Tangent: Using

Sign in to follow this  

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


Sign in to follow this  


4 Comments


Recommended Comments

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

Share this comment


Link to comment
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...

Share this comment


Link to comment
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

Share this comment


Link to comment
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!

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now