Dear Wamberto,
In Ciao, unlike in SICStus, there is a clear separation between compile-time actions and run-time actions. The effect of the op/3 declaration applies only at compile-time, and furthermore only to the source where the declaration appears. Thus, in order of making the operator active at run time, you must make a call to the op/3 builtin where appropriate, for example:
------------------------------------------------------ :- use_module(library(read)). :- use_module(library(write)). :- use_module(library(operators)).
main :- op(950,xfx,'==>'), open('file.pl',read,Stream), read(Stream,A), close(Stream), write(A), nl. ------------------------------------------------------
Just for compatibility, there is a package in the standard library called 'runtime_ops' which makes op/3 declarations affect run-time (by the use of a ":- initialization" declaration). Using the package, your program would be as
------------------------------------------------------ :- use_package(runtime_ops). :- op(950,xfx,'==>').
:- use_module(library(read)). :- use_module(library(write)).
main :- open('file.pl',read,Stream), read(Stream,A), close(Stream), write(A), nl. ------------------------------------------------------
Regards,
Daniel Cabeza