Phil Tomson wrote:
> >> Procs, Bindings and Continuations contain references to C stack
> >> information which is not portable.  Methods have references to C
> >> function.  All of above information is not portable.
> >
> 
> This seems reasonable, but it also means that I can't use Proc's with 
> dRuby since dRuby uses Marshalling. :-(  I was thinking of sending Proc's 
> over to objects running on different machines (using dRuby).

It is possible to use Proc's and Code-Blocks onto remote objects using dRuby.
All objects that cannot be marshalled are passed by reference. To pass your own
"marshallable" objects as references, just include module DRb::DRbUndumped (DRbUndumped).

To demonstrate the usage of iterators, the following example iterates over a remote file.

# ----------- server ------------
require "drb/drb"
primary = DRb::DRbServer.new("druby://0.0.0.0:5555", File.new(ARGV.shift, "r"))
primary.thread.join

# ----------- client ------------
require "drb/drb"
primary = DRb::DRbServer.new
ro = DRb::DRbObject.new(nil, ARGV.shift)
ro.each {|line|
  puts line
}



Regards,

  Michael

-- 
Michael Neumann
merlin.zwo InfoDesign GmbH
http://www.merlin-zwo.de