On 8/15/05, Eric Hodel <drbrain / segment7.net> wrote:
> On 14 Aug 2005, at 12:40, Mark Volkmann wrote:
> 
> > The source file lib\ruby\1.8\drb\drb.rb defines the class DRbObject. I
> > don't understand the initialize method. Why would I ever want to pass
> > something other than nil for the first parameter? The comment above
> > the initialize method says that is used to create a proxy/stub for a
> > local object. Why would I want to do that?
> >
> > The typical way to use this is
> >
> > proxy = DRbObject.new(nil, url)
> 
> You can pass DRbObjects across the wire, so you could wrap a local
> object and pass the DRbObject across the wire to the other side.  If
> you look around in drb.rb you'll see several places where it is used.

Are you saying that this is a way to force a pass by reference?
I can also do that with DRbUndumped.
Are these blocks of code equivalent in what they accomplish?

obj.extend DRbUndumped
remote_obj.some_method(obj)

remote_obj.some_method(DRbObject.new(obj))

-- 
R. Mark Volkmann
Partner, Object Computing, Inc.