ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-AI
perl-AI
Prolog/Perl variadic predicates
by Ovid other posts by this author
Jul 16 2002 7:35PM messages near this date
Prolog in Perl | Re: Prolog/Perl variadic predicates
This is a follow up to my previous email re:  http://www.perlmonks.org/index.pl?node_id=1819
80.

Since I'm trying to create "Perlog", a Prolog-like implementation in Perl, I've run across a
n
issue which could cause some problems.  Specifically, are variadic (varying number of argume
nts)
predicates allowed in Prolog?  In other words, can someone do this:

  foo( bar, baz ).
  foo( bar, quux, camel ).

I think I have the data structure issue figured out, but if I have to allow for the above sy
ntax,
I'm going to have problems auto-generating code.

I'm *assuming* that anything approaching variadic predicates would be handled with lists, th
ereby
avoiding the problem:

  foo( bar, [ baz ] ).
  foo( bar, [ quux, camel ] ).

If variadic predicates are allowed, what would they be used for?  If I can safely exclude th
em
from the Perl implementation, this would make life much easier.

Cheers,
Curtis "Ovid" Poe

=====
"Ovid" on http://www.perlmonks.org/
Someone asked me how to count to 10 in Perl:
push@A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//;
shift@a;shift@a if $a[$[]eq$[;$_=join q||,@a};print $_,$/for reverse @A

__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com
Thread:
Ovid
Ovid
Lee Goddard
Ovid
Ovid
Lee Goddard
Andreas Marcel Riechert

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved