I’ve been using Ruby for about a month now and it’s become my favorite
language by far. I don’t know if RCR’s are still being accepted, but
I know you’re supposed to post changes here before submitting. So
here are some things I’ve noticed. I don’t know if any are worthy of
change requests, but here they are.
def ought to return a Method object. Just because. Having def
return an object adds a little bit of consistency, IMO.
Top-level defs should be singleton methods in an Object instance
dedicated to that file. It’s messy that a top-level def can be called
on any object.
The pipes on a parameter list for a do block ought to be optional.
I’m not sure about this one.
caller should provide the sender of the current message.
All special $ variables out to be deprecated or even removed.
There ought to be some way to assign to a receiver object, or
overload = or something.
Perhaps some kind of site-level initialization file in
lib/site_ruby that would be called before any script is loaded to add
methods to the default classes.
Some of these are probably crazy. Please don’t take offense to them.
I’ve been using Ruby for about a month now and it’s become my favorite
language by far. I don’t know if RCR’s are still being accepted, but
I know you’re supposed to post changes here before submitting. So
here are some things I’ve noticed. I don’t know if any are worthy of
change requests, but here they are.
feel free to post rcr to http://www.rcrchive.net
the discussion about them happens there as well and is saved for
posterity
def ought to return a Method object. Just because. Having def
return an object adds a little bit of consistency, IMO.
I’d prefer a symbol, FWIW
Top-level defs should be singleton methods in an Object instance
dedicated to that file. It’s messy that a top-level def can be called
on any object.
Not sure I understand, if you want methods not in top òlevel why don’t
you use a module?
The pipes on a parameter list for a do block ought to be optional.
I’m not sure about this one.
it makes block impossible to parse, I believe. I suggested removing
just one of the pipes and that mad blocks hard to parse anyway
All special $ variables out to be deprecated or even removed.
they will, just not too soon, google for one of the last ruby-dev
summaries
At Thu, 15 Apr 2004 03:24:16 +0900,
Bill Atkins wrote in [ruby-talk:97173]:
def ought to return a Method object. Just because. Having def
return an object adds a little bit of consistency, IMO.
Method object is not method itself, rather a wrapper for it,
whereas Class is the class itself. I feel Symbol would be
enough.
Top-level defs should be singleton methods in an Object instance
dedicated to that file. It’s messy that a top-level def can be called
on any object.
If you feel so, don’t use top-level methods, define in
meta class.
class << self
def foo
end
end
Methods need to be visible everywhere would be top-level.
The pipes on a parameter list for a do block ought to be optional.
I’m not sure about this one.
By “pipes”, do you mean this?
foo do |this| end
Then, it’s optional, you can omit it if you don’t use it.
caller should provide the sender of the current message.
Particular method instead of parsing strings?
All special $ variables out to be deprecated or even removed.
It will.
There ought to be some way to assign to a receiver object, or
overload = or something.
Assignment is not an operation on an object.
Perhaps some kind of site-level initialization file in
lib/site_ruby that would be called before any script is loaded to add
methods to the default classes.
def ought to return a Method object. Just because. Having def
return an object adds a little bit of consistency, IMO.
I’d prefer a symbol, FWIW
But a symbol itself has no connection back to the class or method. Should it
instead be some object that combined [UnboundMethod + Symbol], or something
like that?
The pipes on a parameter list for a do block ought to be optional.
I’m not sure about this one.
By “pipes”, do you mean this?
foo do |this| end
Then, it’s optional, you can omit it if you don’t use it.
I understood that he liked the pipe characters to be optional, but not
neccessarily the parameter list, so as to be allowed to wrint something
like this:
The pipes on a parameter list for a do block ought to be optional.
I’m not sure about this one.
By “pipes”, do you mean this?
foo do |this| end
Then, it’s optional, you can omit it if you don’t use it.
I understood that he liked the pipe characters to be optional, but not
neccessarily the parameter list, so as to be allowed to write something
like this:
def ought to return a Method object. Just because. Having def
return an object adds a little bit of consistency, IMO.
I’d prefer a symbol, FWIW
But a symbol itself has no connection back to the class or method. Should it
instead be some object that combined [UnboundMethod + Symbol], or something
like that?
this has been suggested already IIRC.
My point is that
I never used an UnboundMethod
I could write 'private def f(); end
Nothing really important.
After that Obviously I’ll ask for public/private/protected to return
anopther symbol, and concatenate final() abstract() synchronized() and
stuff like that
def ought to return a Method object. Just because. Having def
return an object adds a little bit of consistency, IMO.
I’d prefer a symbol, FWIW
But a symbol itself has no connection back to the class or method. Should it
instead be some object that combined [UnboundMethod + Symbol], or something
like that?
def ought to return a Method object. Just because. Having def
return an object adds a little bit of consistency, IMO.
I’d prefer a symbol, FWIW
But a symbol itself has no connection back to the class or method. Should it
instead be some object that combined [UnboundMethod + Symbol], or something
like that?
this has been suggested already IIRC.
My point is that
I never used an UnboundMethod
I could write 'private def f(); end
I remember from my nuby days (ok, ok, my total nuby days) a thread on this -
the separate 'private :meth" line was the only thing that grated on me when I first
started. Did that ever go anywhere?
After that Obviously I’ll ask for public/private/protected to return
anopther symbol, and concatenate final() abstract() synchronized() and
stuff like that
Oh, they can stay back in PoorMansSmalltalk land please. They’re part of
the reason I left
···
–
I bet the human brain is a kludge.
– Marvin Minsky
Rasputin :: Jack of All Trades - Master of Nuns