General

Profile

gcao (Guoliang Cao)

  • Login: gcao
  • Email: gcao99@gmail.com
  • Registered on: 03/29/2012
  • Last sign in: 03/09/2013

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 0 3 3

Activity

03/09/2013

01:11 PM Ruby Feature #7998: "def" should return a value (the symbol of the method name) instead of nil
This is a nice addition indeed and I remember I asked for it too in the
past. One usage could be method annotation like what is done in some
command line library:
desc 'Do something'
def do_something
...
end
The above code l...
gcao (Guoliang Cao)
05:37 AM Ruby Bug #8052: "prepend Mod1, Mod2" behaves strangely
My bad :-D
I was so excited that I found a bug in Ruby... just kidding.
gcao (Guoliang Cao)
04:40 AM Ruby Bug #8052 (Rejected): "prepend Mod1, Mod2" behaves strangely
I did some quick experiment with prepend and noticed a strange behavior.
"prepend B; prepend C" and "prepend B, C" produce same ancestors. However, their behaviors are different.
IMHO, "prepend B, C" should just insert B and C int...
gcao (Guoliang Cao)

04/01/2012

01:10 PM Ruby Feature #6222: Use ++ to connect statements
You are right, anything other than 'then' or maybe 'also' hurts readability. Guess I'm too obsessed with finding something that can work for this case :-P
gcao (Guoliang Cao)

03/31/2012

11:53 PM Ruby Feature #6222: Use ++ to connect statements
Even though using 'also' means adding a new keyword and breaks compatibility, practically no one uses it as method name or variable name. I searched my whole ruby lib directory, it never appeared in code.
Another candidate is \\. It doe...
gcao (Guoliang Cao)

03/30/2012

02:35 AM Ruby Feature #6222: Use ++ to connect statements
I agree.
If 'then' or '++' does not work, what about 'also'? I'm not a native English speaker and not sure whether it sounds natural. Maybe someone can come up with something that fits well to this case.
do_this also do_that a...
gcao (Guoliang Cao)
01:01 AM Ruby Feature #6222: Use ++ to connect statements
Sorry I didn't know this. I have never seen ++ in ruby code (except probably in books) and that made me think it is not valid syntax. Wonder what is the usefulness of '1 + +1' though. gcao (Guoliang Cao)

03/29/2012

11:54 PM Ruby Feature #6224: Make variables in if/unless conditions available to conditional statements
I found this issue created 3 years ago. Matz explained the reason behind.
http://bugs.ruby-lang.org/issues/1141
gcao (Guoliang Cao)
11:13 PM Ruby Feature #6224 (Rejected): Make variables in if/unless conditions available to conditional statements
I propose to make below code work
do_something(a) if a = condition
Above code should work exactly same as
if a = condition
do_something(a)
end
If there is a reason behind why the first case does not work, please l...
gcao (Guoliang Cao)
10:59 PM Ruby Feature #6222 (Rejected): Use ++ to connect statements
I propose to use ++ to connect two or multiple statements, e.g.
do_this ++ do_that ++ do_something
It is equivalent to (do_this; do_that; do_something) but more readable.
It can be used to replace below idiom
do_something and...
gcao (Guoliang Cao)

Also available in: Atom