Additionally, there are new parse options that allow for programming without the "$" and "$." signs for variables, class method calls, and object member references.
This last change hopefully will make a lot of people happy - I had a lot of requests to do away with the "$" signs, and now it's possible. Unfortunately, the code highlighting solutions out there will have to be updated again to handle the new %allow-bare-refs and %new-style parse options. %new-style combines both of the new parse options %allow-bare-refs and %assume-local, the latter meaning that all variables are assumed to have local scope unless declared global.
Here is an example with %new-style:
%new-styleBackwards compatibility is a priority and has been maintained. We'll see if the decision to allow for this new programming style is a good one; sometimes too much choice can just lead to confusion and therefore is counterproductive. However at least some people are very happy with it.
int sub do_something(int p1, string str, *hash h) {
for (int x = 0; x < p1; ++x) {
stderr.printf("error: %s\n", str);
}
return p1 + 2;
}
No comments:
Post a Comment