Name: Anonymous 2008-04-10 0:39
Came up with this great idea while I was reading SICP today, what does /prog/ thinK?
As I was calling the method .subString I was thinking to myself how nice it would be if function parameters could have their own scope.
So instead of calling.
c.substring(1, c.length()-1)
You could call
c.substring(1, length-1)
And for the length variable in the string class you would do something like.
FunctionScope int length;
Though a similar syntax you could get rid of the common static identifier in dot net.
For example maybe for functions where an enumerator is wanted.
add(String a, Type.visibletrue)
could be
add(String a, visibletrue)
The latter syntax probably should need nothing but that, because if you are passing an enumerator and the only two valid values are static variables then it should be able to correctly determine the type without the Type. in front.
Obviously this could probably be done in a more correct or better fashion, but I think it is an idea that has some merit to it.
Terra
As I was calling the method .subString I was thinking to myself how nice it would be if function parameters could have their own scope.
So instead of calling.
c.substring(1, c.length()-1)
You could call
c.substring(1, length-1)
And for the length variable in the string class you would do something like.
FunctionScope int length;
Though a similar syntax you could get rid of the common static identifier in dot net.
For example maybe for functions where an enumerator is wanted.
add(String a, Type.visibletrue)
could be
add(String a, visibletrue)
The latter syntax probably should need nothing but that, because if you are passing an enumerator and the only two valid values are static variables then it should be able to correctly determine the type without the Type. in front.
Obviously this could probably be done in a more correct or better fashion, but I think it is an idea that has some merit to it.
Terra