 ipc = require 'ipc'
+v8_util = process.atom_binding 'v8_util'
 
 generateFromPainObject = (plain) ->
   switch plain.type

              # Function call.
              ret = ipc.sendChannelSync 'ATOM_INTERNAL_FUNCTION_CALL', plain.id, Array::slice.call(arguments)
              return generateFromPainObject ret

      # Polulate delegate members.
      for member in plain.members

    when 'value' then plain.value
    when 'array' then (generateFromPainObject(el) for el in plain.members)
    else
      if plain.type is 'function'
        # A shadow class to represent the remote function object.
        ret =
        class RemoteFunction
          constructor: ->
            if @constructor == RemoteFunction
              # Constructor call.
              obj = ipc.sendChannelSync 'ATOM_INTERNAL_CONSTRUCTOR', plain.id, Array::slice.call(arguments)

