Yukihiro Matsumoto
10/20/2007 10:29:00 AM
Hi,
In message "Re: ruby wish-list"
on Sat, 20 Oct 2007 08:20:33 +0900, Suraj Kurapati <snk@gna.org> writes:
|1. Use "new" as the name of the constructor instead of "initialize".
|You can keep "initialize" around for legacy support; just "alias
|initialize new" for the future.
Besides that renaming hook like "initialize" is far more difficult
than you expect, I don't think "new" is sufficient name for instance
initialization hook.
|2. Fix the Ruby parser to treat // (literal regexp) just like the
|%r{...} (also literal regexp) construct so that you aren't forced to use
|parentheses in method calls:
|
| $ ruby -v
| ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux]
|
| $ ruby -w -e '"foo".sub /o$/, "x"'
| -e:1: warning: ambiguous first argument; put parentheses or even spaces
No matter how much you hate this warning, ambiguity would not go away.
If you don't put parentheses around arguments, the parser confuses
division operator (/) and regular expression at the first argument.
matz.