|
|
|
|
|
by superdisk
2429 days ago
|
|
The problem is, once you introduce a non-logical predicate, everything in the call stack "above" it is tainted and rendered non-logical. Since you frequently have to resort to using (\+)/1 almost as a necessity, the codebase ends up being 90% illogical and 10% logical. And at that point you step back and ask why you're even using prolog. However: I do miss DCGs in every other language I've used. They're so useful that I've come to hate using regexes or even worse: manually parsing lists and strings. |
|
That's a very general statement. The non-logical behavior can be well-contained and unobservable from the outside. For example, the nice and pure if_/3 internally uses both of the non-logical predicates (->)/2 and (==)/2. Yet viewed from the outside it doesn't taint anything.
> And at that point you step back and ask why you're even using prolog.
As I wrote above, because I think even used imperatively it's a very convenient language for expressing matching and transformation of trees. And DCGs are great as well, I agree.