t; *From:* ironruby-core-boun...@rubyforge.org [mailto:
> ironruby-core-boun...@rubyforge.org] *On Behalf Of *Ryan Riley
> *Sent:* Friday, January 09, 2009 2:33 PM
> *To:* ironruby-core@rubyforge.org
> *Subject:* Re: [Ironruby-core] Generic method synxtax
>
>
>
> How would this loo
-core@rubyforge.org
Subject: Re: [Ironruby-core] Generic method synxtax
How would this look for instantiating a generic object?
my_object = Foo.method(:new).of(Bar).call
That seems strange. Perhaps we need to possibilities: the above for generic
methods and the following for generic classes:
my_o
Generic types already work:
List = List.of(Object).new
Tomas
From: ironruby-core-boun...@rubyforge.org
[mailto:ironruby-core-boun...@rubyforge.org] On Behalf Of Ryan Riley
Sent: Friday, January 09, 2009 2:33 PM
To: ironruby-core@rubyforge.org
Subject: Re: [Ironruby-core] Generic method synxtax
How would this look for instantiating a generic object?
my_object = Foo.method(:new).of(Bar).call
That seems strange. Perhaps we need to possibilities: the above for generic
methods and the following for generic classes:
my_object = Foo.of(Bar).new
# where Foo would be defined as Foo in C#
my_c
lf Of Ryan Riley
Sent: Friday, January 09, 2009 1:51 PM
To: ironruby-core@rubyforge.org
Subject: Re: [Ironruby-core] Generic method synxtax
I like Tomas's idea the best. Generics are not native to Ruby, so most people
using them will likely have a C#/VB background, which means Tomas's s
I like Tomas's idea the best. Generics are not native to Ruby, so most
people using them will likely have a C#/VB background, which means Tomas's
syntax would be more familiar.
The "_of" syntax isn't bad, but forcing a ".do" or ".call" at the end isn't
ideal, even if it does have a bit of a Ruby f
Another suggestion is to use name mangling to append "_of" to the method name.
This could return an object with a method called "do", "call", or something
like that. Since we already do name mangling from PascalCase to under_scores,
this could work out. It avoids having to pass the type paramete