On Tue, Jul 10, 2012 at 12:36 PM, Kurt Werle <k...@circlew.org> wrote:
> On Monday, July 9, 2012 12:10:07 PM UTC-7, Nicolás Sanguinetti wrote:
>>
>> dup doesn't take arguments because in ruby dup doesn't take arguments. It
>> wouldn't make sense to break the semantics of ruby just for this, IMO.
>
>
> I had not considered that.  On the other hand:
> * it's not like dup calls super (which seems wrong to me, now that I think
> about it)

Well, the thing is, you are not supposed to redefine #dup, the same
way you're not supposed to redefine Class#new and instead use
Object#initialize.

With #dup, however, you're supposed to implement #initialize_copy,
that takes the object you want to make a shallow copy of.

Cheers,
-foca

> * dup with no args would continue to behave exactly the same as it does, now
>
> Kurt
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/rubyonrails-core/-/xB0hhO8wXqwJ.
>
> To post to this group, send email to rubyonrails-core@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-core+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-core?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-core+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to