call as a substitute for macros or functional programming?

Ross Boylan <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Organization UCSF
Message-ID <[email protected]>
I have code that I'm using with various small modifications; at the moment I do 
this by copying, pasting and editing.  In other languages I could avoid this 
by passing functions into functions or using a macro/template system.

It looks as if call/n will give me something like functional programming, 
e.g.,
silly(Src, Dest, Op) :- call(Op, Src, Dest).

?- silly(path([ostempserver1]), S, content_for).
gives the same result as
?- content_for(path([ostempserver1]), D).

Is this the right approach?  Are there others I should consider?

Thanks.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.