🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #2786

Re: PROLOG Digest V5 #67

#2786
From: dowding
Date: Tue, 29 Sep 1987 15:59
43 lines
2336 bytes
>Date: Sat, 26 Sep 87 15:40:33 PDT
>From: Richard A. O'Keefe <quintus!cresswell!ok@Sun.COM> 
>Subject: The call/N family.
>

I enjoyed this response by O'Keefe very much.  I would like to see more
advice from the Prolog sages on the net.  I do have a few small comments
to make:

>In those Prolog systems such as
>micro-PROLOG or LM-Prolog where there is only one functor (./2) univ
>and = tend to have the same implementation.  The LM-Prolog manual
>explicitly states that "=.." is equivalent to "=".  

This also used to be true of Symbolics Prolog (it may have been changed in
recent releases), and it has caused some compatablity problems, namely when 
the left-hand-side of "=.." is an atom:

foo =.. [foo]

but foo should not unify with [foo].

>
>Oh yes, the reason why univ is intrinsically inefficient is that it
>involves constructing a list that you don't really want.  It takes
>time to make the list and more time to garbage collect it.  You are
>better off not making it in the first place, EXCEPT in those systems
>where =.. and = are identical.
>

I think that there are still cases in which you must use "=..".  Take,
for instance, the program that takes a DCG and produces equivalent
Prolog code.  This program must add to arguments to the end of every 
procedure call in the DCG.  This cant be done with call/N family because
you dont want to execute the procedure call, just create it.  Because you
dont know in advance how many arguments the nonterminals will have, you
must use "=..", not functor and arg.  In this case, you really do
want to construct this list.

John Dowding


-- 
Technical Details
Message-ID: <3321@bigburd.PRC.Unisys.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!rutgers!sunybcs!bingvaxu!leah!itsgw!batcomputer!cornell!rochester!udel!burdvax!bigburd!dowding
References: <8709280717.AA26910@ucbvax.Berkeley.EDU>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!rutgers!sunybcs!bingvaxu!leah!itsgw!batcomputer!cornell!rochester!udel!burdvax!bigburd!dowding
From: dowding@bigburd.UUCP
Newsgroups: comp.lang.prolog
Subject: Re: PROLOG Digest   V5 #67
Message-ID: <3321@bigburd.PRC.Unisys.COM>
Date: Tue, 29-Sep-87 11:59:24 EDT
Article-I.D.: bigburd.3321
Posted: Tue Sep 29 11:59:24 1987
Date-Received: Fri, 2-Oct-87 05:47:17 EDT
References: <8709280717.AA26910@ucbvax.Berkeley.EDU>
Sender: news@bigburd.PRC.Unisys.COM
Distribution: world
Organization: Unisys Corporation, Paoli Research Center; Paoli, PA
Lines: 43
Summary: reply to O'Keefe