------art_157268_14441364.1169209677920
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On 1/19/07, David Chelimsky <dchelimsky / gmail.com> wrote:
>
> Wow. You guys are all coming up w/ great alternatives, but would
> somebody please just answer my question? I am not asking for ways to
> do what I want. I'm asking if you think the following proposed syntax
> addition would be useful:


Your idea is intriguing
you can already do

    proc{ |@a| }.call(42)

so why not allow instance methods as formal parameters for methods?
By no means such a construct should be reduced to #initialize it should be
legal for every method of course.
Now I am not qualified to talk about impacts or implementation details.
Given that so many people have already implemented this it seems a desired
features.
I would vote "in favour" maybe even "strongly in favour" for such a RCR. I
will listen to wiser guys before voting though.

Cheers
Robert

Any parameter preceded by a @ results in an instance variable being
> created and initialized with the submitted value. So:
>
> class MyClass
>   def initialize(@a)
>   end
> end
>
> instance  yClass.new(5)
> #results in an instance variable @a with a value of 5
>
> This would apply to any parameter in the list, including those with
> default values.
>
> MyClass
>   def initialize(@a, @b0
>   end
> end
>
> instance  yClass.new(5)
> #results in an instance @a   and @b  
>
> instance  yClass.new(5, 4)
> #results in an instance @a   and @b  
>
> Does this seem like a good thing to propose?


See above for *any* method of course.

Thank you,
> David
>
>
Cheers
Robert

-- 
"The best way to predict the future is to invent it."
- Alan Kay

------art_157268_14441364.1169209677920--