|
|
|
|
|
by upghost
501 days ago
|
|
I think there is some confusion around what is "first class" in Prolog. Any syntactically valid construct in (ISO-conforming) Prolog is "first class", including the symbols that are the names of predicates. The fact that Prolog is a homoiconic language makes any valid Prolog code "first class". "First class" meaning, can be the arguments to a predicate or processed as data. Predicates (and only predicates) can be called with `call/N` -- although you could write a meta-interpreter with different properties. You could pass in the number `1` and call a randomly determined predicate, as an absurd example. Perhaps you mean, "the head and body of a predicate are not first class" ? This again is false. They are valid data and can be processed as such -- please see [4] for clarification. Perhaps you mean "they cannot be looked up dynamically at runtime" -- this is also false, please see [3]. Are there other eligibility requirements for "first class" that we should discuss? |
|
First class data, yes. First class predicate, no.
> Predicates (and only predicates) can be called with `call/N`
Some class of things that you apparently refuse to call "predicates" can also be called, but without having to use call/N.
> Perhaps you mean, [...]
No. I mean there are first-class callable things and second-class callable things, and second-class things are not first class.