is/2 is arithmetic function evaluation from the original Prolog
But in SWI-Prolog you can have function evaluation also for other uses using dicts. Predicates can be associated to dicts, and they behave like function calls. This gives us function calls beyond the arithmetic evaluation of is/2. For example, for strings you can do things like this:
Define a module called string
to associate functions to dicts with tag string
(there is a problem in that modules are not hierarchical so you may end up with a name clash in the unique global module space, but, let's disregard this for now):
:- module(string,[]). % This is a predicate format/3 written as a function format/2 (maybe there % needs to be a new descriptor syntax: format///2 ?) taking a dict tagged as % "string" and two arguments which evaluates to the value of variable Text. S.format(Msg,Args) := Text :- with_output_to(string(Text),format(Msg,Args)).
Once the above module has been loaded, you can do things like these, which behave like a Java "static" method call (you can move args into the dict too of course):
?- X=string{}.format("Hello, ~q\n",["World"]). X = "Hello, \"World\"\n".
?- debug(foo),debug(foo,string{}.format("Hello, ~q\n",["World"]),[]). % Hello, "World"