On Thursday, August 14, 2003, at 11:09  AM, Its Me wrote:

>
> "Richard Kilmer" <rich / infoether.com> wrote:
>> BTW:  Although refactoring is important, so is generating code.  That
>> could be done quite quickly yet yield nice payoff.
>
> That's intriguing. Do you mean that Ruby could be used at slightly 
> higher
> level so the descriptions are less sensitive to common re-factorings? 
> Would
> you then leave the re-factorings to the 'code-generation' 
> functionality?
>

Well, you already do dynamic code generation in the language itself:

class Foo
    attr_accessor :bar
    # the attr_accessor method generates the following code (with eval):
    def bar=(value)
      @bar = value
    end
    def bar
      @bar
    end

That is powerful...but not what I am talking about.

Here is a simple example:

class Foo
   def intialize(x,y,z)

# at this point I press a magic generator key and this code appears:

     @x = x
     @y = y
     @z = z

# and then displays a dialog to chose which of these you want 
externalized
# (if any) and inserts (above def initialize...) something like..

    attr_accessor :x,:y
    attr_reader :z

# and then I can continue with my coding...

Ruby is already fast to code in, but there is still common things that 
could be automated...that's all.

-rich