![]() |
Code Example: REBOL/Services RPC clientREBOL [ Title: "REBOL/Services RPC client" Author: "Gabriele Santilli" Version: 1.0.0 ] do http://www.rebol.net/rebservices/client.r import-funcs: func [ "Import remote functions" port "REBOL/Services port" /local name spec call ] [ funcs: copy next fourth do-service port [rpc/list-funcs] parse funcs [ some [ set name set-word! spec: block! ( call: make block! length? spec insert insert tail call [rpc/do] to word! name parse spec/1 [ some [ string! | block! | /local break ; should not actually be needed | set name [word! | refinement!] (insert/only tail call make paren! reduce [to get-word! name]) ] ] spec/1: func spec/1 compose/only [ second fourth do-service (port) compose/only (call) ] ) ] ] construct funcs ] example: [ url: http://www.rebol.net/cgi-bin/services.r port: open-service url remote: probe import-funcs port probe remote/append [1 2 3] 4 probe remote/append/only [1 2] [3 4] probe remote/sum [1 2 3 4] ] ?? example do example halt |
![]() |
Updated 31-Mar-2007, WIP Wiki, REBOL/Core 2.5.58.4.2 - Copyright 2005 REBOL Technologies - WWW.REBOL.COM - Edit |