Mark, Is it possible for us to get a Typedef keyword? Basically just use it as an alias for another type. This would give us the ability to change the type of a value anywhere.
Trans can convert it internally before outputting code. It could even be a preprocessor keyword.
#Typedef HealthType=Int
Class Unit
Field health:HealthType
Method SetHealth:Void(health:HealthType)
Self.health = health
End
End This would be the same as simply using Int. If in the future you want to use a float to store health, it's as easy as changing the typedef rather than changing all references to the health field.
|