zdennis wrote:
I had to think about half a second, and then type for about 8 seconds.
Just copy and paste the code and put it in a file that you
require on your projects, and you won't have to think. I will think for
you. Matz is busy solving bigger problems and conquering
better obstacles. So he doesn't have to think about this, I will put my
brain to work for him.class Class
def attr_class_accessor arg
instance_eval "class << self ; attr_accessor :#{arg} ; end"
enddef attr_class_reader arg
instance_eval "class << self ; attr_reader :#{arg} ; end"
enddef attr_class_writer arg
instance_eval "class << self ; attr_writer :#{arg} ; end"
end
endIf you feel this stronlgy about your desire to simplify this, perhaps
you should submit it as an RCR, http://www.rcrchive.net. I
am not saying I think your idea to simplify this into a builtin part of
ruby is a bad thing, but I think that you should not
abolish your ability to think. Ruby gives you power, use it. And if you
think it can be made better, submit a patch or submit an RCR.Matz gives you the power to influence the langauge, I challenge you to
do so.
It's not so much that I feel strongly as much as that it perplexes me. I
guess I just wanted to make sure my meds haven't been replaced with
crazy pills.
I thought of this, too: isn't it odd that you can define class variables
in a definition of how instances of a class should work, but you can't
define their accessors? It seems inconsistent. If it's agreed that this
is inconsistent, I'll post something to the site you mentioned, but if
it's that way for a reason, I'll just take your much appreciated advice,
learn that much more, and be that much less of a newbie.
···
--
Posted via http://www.ruby-forum.com/\.