🎉 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: Local Variable Declarations

Published June 05, 2008
Advertisement
I added in local variable declarations to the Tangent syntax.

Unfortunately they don't quite line up with C#, mostly because types can act as unary operators. type foo = bar; becomes a bit ambiguous if type can act as a unary op. Is it a variable declaration, or is foo supposed to be a param to type, and the result assigned? Almost always the first, but requires a bit of work /lookahead to determine that.

So you'll need to use 'new' to disambiguate them (or perhaps 'local'):

new int x = 42;

Not fantastically ideal, but adjustments are not unexpected when making relatively far reaching changes in a language. The parsed bits don't work yet. That's for tomorrow or the weekend.
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