Sorry if this is a basic question. Here are a simple type and a simple 
function changing an instance in place:

type Something
  val :: Int

  function Something()
    return new(0)
  end
end

function set_value(something :: Something, value :: Int)
  something.val = value
  return
end

I'd like to create a remote instance of `Something`, and then call 
`set_value()` on it remotely. The naive way doesn't work:

$ julia -p 2
julia> @everywhere include("something.jl")

julia> remote_thing = remotecall(2, Something)
RemoteRef(2,1,9)

julia> thing = fetch(remote_thing)
Something(0)

julia> remotecall(2, set_value, thing, 1)
RemoteRef(2,1,11)

julia> thing
Something(0)

One way to make it work is to change `set_value()` so it returns the 
updated `thing`.
But is there a way to call `set_value()` with whatever `remote_thing` is 
pointing to on the remote node as argument without changing `set_value()`?

Thanks.

Reply via email to