Example



next up previous WS Presentations Main Page
Next: Demo Outline Up: Document: ciao Previous: Active Modules /

Example

Simple server:

:- module(popserver,[population/2,stop/0],ciao(h)).
:- ensure_loaded('filebased_server_locator.cl').

population(spain,40).
population(germany,80).
population(italy,60).

stop :- halt.

:- save_addr_active_module(simple_server).


Simple client:

:- module(simple_client,_,ciao(h)).

:- use_active_module(popserver,[population/2,stop/0]).
:- ensure_loaded('filebased_server_locator.cl').

pop(X,Y) :- population(X,Y).

add_pop(S) :- findall(P,pop(_,P),L), sumlist(L,S).

sumlist([],0).
sumlist([X|T],S) :- 
        sumlist(T,S1),
        S is X + S1.



Thu Jan 18 11:29:48 MET 1996 <herme@fi.upm.es>-<webmaster@clip.dia.fi.upm.es>