Details
-
Wish
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
For long variable names, it might be useful to have a with() block-oriented statement for doing naming.
ie.:
longVariableName.x();
longVariableName.y();
longVariableName.property.z();
becomes:
with( longVariableName )
{
x();
y();
property.z();
}
A global statement version could be used to import names and objects.
with java.lang.Math;
would have the effect of making all the Math.* fields and methods accessible without offset. That said, "import" might be the better keyword to use, in this case.
There is a possibility that with() {} could be implemented as a closure, but I think a bare language feature would be more useful, as it is just syntactic sugar, and shouldn't incur any runtime penalty.