Hi Lutz,
The Str-Expr in net-eval is very strict it seems. Im unable to replace the
str-expr position with any variable else then something between {} or "".
but this does not work and is quite pitty..->
> (setq X {(+ 3 4)})
"(+ 3 4)"
> (net-eval '( ("host" 4444 X )) 5000)
string expected in function net-eval : X
Secondly: (This is a big wish!) Does 'net-eval return ALL the eval-return-data in 1 LIST! or only last result? Because thats a BIG
advantage above 'eval-string if net-eval could..! ;-)
Regards, Norman.
net-eval
Prepare the list(s) for net-eval before unsing functions like 'list' or 'expand':
Typically you have a list of tasks to distribute to a list of nodes and then use something like 'map' and 'list' to construct the 'net-eval' list for multiple worker nodes.
If you want to return two results put them in a list:
Lutz
Code: Select all
> (set 'X {(+ 3 4)})
"(+ 3 4)"
> (set 'L (expand '(("host" 444 X)) 'X))
(("host" 444 "(+ 3 4)"))
;; or
> (set 'L (list (list "host" 444 X)))
(("host" 444 "(+ 3 4)"))
>
If you want to return two results put them in a list:
Code: Select all
> (net-eval '(("localhost" 4711 {(list (+ 3 4) (+ 5 6))})) 1000)
((7 11))
>
-
- Posts: 2038
- Joined: Tue Nov 29, 2005 8:28 pm
- Location: latiitude 50N longitude 3W
- Contact:
I still don't understand why this happens, though:
works fine, but
doesn't. I saw your preparation , Lutz, but why does the language appear not to work correctly or predictably in this instance?
Code: Select all
(net-eval '(("10.0.1.3" 4711 "(+ 2 2)")) 1000 )
Code: Select all
(set 's "(+ 2 2)")
(net-eval '(("10.0.1.3" 4711 s)) 1000 )
.... what can help in this instance is 'letex' or 'expand' as shown in this example:
The letex could be embedded ina function supplying "localhost" etc. in variables.
Lutz
ps: 8.8.9 required
Code: Select all
(letex ((host "localhost") (port 4711) (str "(+ 3 4)"))
(net-eval '((host port str)) 1000))
Lutz
ps: 8.8.9 required
-
- Posts: 2038
- Joined: Tue Nov 29, 2005 8:28 pm
- Location: latiitude 50N longitude 3W
- Contact:
Code: Select all
(define (my-net-eval machine port strn timeout)
(letex ((_host machine) (_port port) (_str strn))
(net-eval '((_host _port _str)) timeout)))
Code: Select all
(set 's "(+ 23 23)")
(my-net-eval "10.0.1.3" 4711 s 1000 )