Grokbase Groups Perl ai July 2002
FAQ
Ovid writes:
Since I'm trying to create "Perlog", a Prolog-like implementation
in Perl, I've run across an issue which could cause some problems.
Specifically, are variadic (varying number of arguments) predicates
allowed in Prolog?
While I always have done some (simple) Prolog, unfortunately it got
rusty. It seems to be better to ask such a question on a Prolog
list. Anyway, I have never used variadic variables and I would be
very surprised if the are allowed in Prolog.
In other words, can someone do this:
foo( bar, baz ).
foo( bar, quux, camel ).
Yes this is allowed in Prolog. But, this are two DIFFERENT predicates
like "@bar" is different from "%bar". Inside Prolog remembers them as
foo/2 or foo/3.

Anyway how about giving up on the thought of implenting Prolog in
Perl. Try to implement logical programming in Perl. Just a matter
of reprogramming your mind;-) If you stop to think "it has to be
like Prolog" things get easier. BTW, appart from Prolog logic-based
languages like Mercury have there appeal as well.
If you decide that giving two predicates the same name is not allowed,
go ahead. Just few yourself as a language designer and not only as
Prolog implementor.

Andreas Marcel

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 7 | next ›
Discussion Overview
groupai @
categoriesperl
postedJul 16, '02 at 4:34p
activeAug 19, '02 at 5:37p
posts7
users3
websiteperl.org

People

Translate

site design / logo © 2021 Grokbase