On 18/05/05, Eric Mahurin <eric_mahurin / yahoo.com> wrote:
> [snip]
> * klass(*args) : you alias the null method to "new" so that
> this would be equivalent ot klass.new(*args).  I tend to forget
> the ".new" more often than I'd like to admit.
> [snip]

I don't know if I like this proposal, but in any case I'd expect a syntax like:

class A
  def initialize(x)
    @x = x
  end
  
  def self.[](x)
    self.new(x)
  end
  
  def self.()(x)
    self.new(x)
  end
end

A[12]
A(12)

for it. (Note that the square brackets already work.)

best regards,

Brian

-- 
http://ruby.brian-schroeder.de/

Stringed instrument chords: http://chordlist.brian-schroeder.de/