🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #3720

Re: In defence of difference-lists.

#3720
From: gerdeman
Date: Thu, 20 Oct 1988 16:47
19 lines
894 bytes
Did something go wrong in the Eureka step here? What does the variable
X do?
	double(X0, X, Y0, Y) :-
		double(X0, X, Y0, Y1, Y1, Y).

	double(X, X, Y, Y, Z, Z).
	double([E|X1], X, [E|Y1], Y, [E|Z1], Z) :-
		double(X1, X, Y1, Y, Z1, Z).

Why not write ;

        double(X0,Y0,Y):-
                double(X0,Y0,Y1,Y1,Y).

        double([],Y,Y,Z,Z).
        double([E|X1],[E|Y1],Y,[E|Z1],Z):-
               double(X1,Y1,Y,Z1,Z).
                      
Technical Details
Message-ID: <16400002@clio>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!ncar!tank!uxc!uxc.cso.uiuc.edu!clio!gerdeman
References: <3002@mulga.oz>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!ncar!tank!uxc!uxc.cso.uiuc.edu!clio!gerdeman
From: gerdeman@clio.las.uiuc.edu
Newsgroups: comp.lang.prolog
Subject: Re: In defence of difference-lists.
Message-ID: <16400002@clio>
Date: 20 Oct 88 16:47:00 GMT
References: <3002@mulga.oz>
Lines: 18
Nf-ID: #R:mulga.oz:3002:clio:16400002:000:453
Nf-From: clio.las.uiuc.edu!gerdeman    Oct 20 11:47:00 1988