listen(+Template,
:Goal)Register a listen channel. Whenever a term unifying
Template is broadcasted, call Goal. The following
example traps all broadcasted messages as a variable unifies to any
message. It is commonly used to debug usage of the library.
?- listen(Term, (writeln(Term),fail)).
?- broadcast(hello(world)).
hello(world)
true.