News for hackers. Stuff that matters.
Re:A Short Introduction to Prolog by _delirium on Friday August 05, 2011 @09:14AM (#2849945)
Unfortunately, no. The names of predicates---functors in Prolog-speak---have to be symbols, not variables, and Horn clauses themselves aren't first-class either.

You can do it via metaprogramming; a functor can be converted to a list [name, param1, param2, ...], and then you can write normal Prolog operations on the list that bind variables and such, and then convert back. This page shows how to use that to build a higher-order map function: http://en.wikibooks.org/wiki/Prolog/Higher_Order_Programming

Here's a paper on other approaches; I'm not sure if any of the higher-order Prolog approaches ever caught on, though: http://www.cs.umbc.edu/courses/771/papers/mu_96_02.pdf

Re:A Short Introduction to Prolog by JadeNB on Friday August 05, 2011 @09:18AM (#2849958)
There are also Prolog-derived languages that support higher-order programming 'natively', such as Teyjus (http://teyjus.cs.umn.edu) and Curry (http://www-ps.informatik.uni-kiel.de/currywiki).
Re:A Short Introduction to Prolog by olliesaunders on Friday August 05, 2011 @09:24AM (#2849980)
Do you use either of these personally? Would you recommend them?
Re:A Short Introduction to Prolog by JadeNB on Friday August 05, 2011 @10:20AM (#2850158)
I had a terrible time getting Teyjus up and running. I played around with Curry a while ago (using PAKCS (http://www.informatik.uni-kiel.de/~pakcs), if I recall correctly), but didn't explore enough to say anything about it.