public class foo{ private int internalX; public int x{ get{ return(internalX); } set{ internalX = value; } }}public static void main(){ local foo bar = new foo; bar.x = 42; print bar.x;}
They should follow the standard C# syntax. Getter only works, setter only untested. Property = Property is untested, but I tried to make sure that it'd work nicely. Invoking the getter/setter using the standard syntax currently works (I need to disable it). And as usual, there's probably some corner cases that don't work quite yet (at least as expected).
A property in Tangent isn't much more than a normal method/method group. Just an extra token to signify that they should be sugared into property syntax. Thus they will likely be assignable to delegates that match the syntax, and passed around as methods/groups can. Declaring the property type as a parameter though will require generics, so isn't available at time of writing.
After Disgaea 3, I'll probably aim for .NET imports, but I might look into something I've been meaning to implement, but haven't quite worked out the details:
Tangent allows you to just stick identifiers next to one another. So something like this is kosher:
Ogre1 smash Knight1
Nice and simple. smash is an infix operator that takes actors. But something like this should be fine too:
Ogre1 move towards Knight1
move would be an infix operator for an actor and some intermediary (towards ) or takes towards and returns an intermediary infix operator.
This sort of thing I think will become (or should become) pretty common in Tangent code. Building it though will involve a number of intermediary types which will be tedious to implement. I should be able to mechanically (and anonymously) implement them. The method declaration would then become something like:
public operator void move towards(Actor Subject, Actor Target);
or (if you wanted a more 2nd-person feel)
public void move (Actor Subject) towards (GameObject Target);
The second would mechanically create three methods.
intermediary0 move (Actor);
intermediary1 towards (GameObject);
void intermediary0 intermediary1
(or)
intermediary0 move (Actor);
intermediary1 intermediary0 towards;
void intermediary1 (GameObject);
The second probably being more consistent. Just need to take my time and wrap my head around the syntax and implementation. One of those things that would probably be a lot easier if I had a theory of computation class under my belt...
Ah well. Properties. w00t.