Ovid <[EMAIL PROTECTED]> 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



Reply via email to