You are really on a roll Wayne.  Great stuff!

I might be wrong but my impression of the IronRuby support for the various
.NET interfaces, such as IDuplicable, IEnumerable and so on, was purely to
support .NET interop and not designed to be the mechanism used by actual
Ruby libraries.  So I suppose the most comprehensive method would be to
support both initialize_copy and IDuplicable if you can and then one or the
other if you can't (i.e. you are developing only in Ruby or you have a 3rd
party .NET class).

Correct me if I'm wrong.

Pete

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Wayne Kelly
Sent: Thursday,28 February 28, 2008 03:51
To: [email protected]
Subject: [Ironruby-core] digest.so implemented

Attached is an implementation of the methods and classes from external
library digest.so that are used by some simple Rails use cases.

----------------------------------------------------------------------------
-------------

I note, that the IronRuby pattern for supporting custom object cloning it to
implement the IDuplicable interface. Is there some reason for this approach
rather than using Ruby's standard mechanism of implementing an
initialize_copy method? With the latter approach, Ruby programmers can
implement their own copy semantics, eg:

class Foo
    def initialize_copy(c)
      puts 'copying'
    end
end
f = Foo.new
g = f.clone


Cheers, Wayne.

_______________________________________________
Ironruby-core mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core

Reply via email to