From Lesta@t-online.de  Wed Sep 13 22:26:45 2000
Received: from mailout01.sul.t-online.com (mailout01.sul.t-online.com [194.25.134.80])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id WAA06827
	for <prolog@swi.psy.uva.nl>; Wed, 13 Sep 2000 22:26:40 +0200 (MET DST)
Received: from fwd01.sul.t-online.com 
	by mailout01.sul.t-online.com with smtp 
	id 13ZJ78-0005kd-0F; Wed, 13 Sep 2000 22:26:38 +0200
Received: from t-online.de (05121269112-0001@[193.159.67.84]) by fwd01.sul.t-online.com
	with esmtp id 13ZJ77-1TqKm0C; Wed, 13 Sep 2000 22:26:37 +0200
Message-ID: <39BFE322.1E948A94@t-online.de>
Date: Wed, 13 Sep 2000 22:27:14 +0200
From: Lesta@t-online.de (Uwe Lesta)
Organization: Lesta
X-Mailer: Mozilla 4.7 [de]C-DT  (WinNT; I)
X-Accept-Language: de,en
MIME-Version: 1.0
To: Ed Kovach <ekovach@franuniv.edu>,
        swi prolog mailing list <prolog@swi.psy.uva.nl>
Subject: Re: troubles with SWI -Prolog
References: <001101c01dbe$c7c5e1c0$3520a8c0@cis78vyz68.franuniv.edu>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Sender: 05121269112-0001@t-dialin.net



> Ed Kovach schrieb:
> 
> Hi,
> 
> I'm having some problems getting some list operations to work.  The code is below
> 
> member1(X, [X | Tail] ).
> 
> member1(X, [Head | Tail] ) :- member1(X, Tail).
> 
> conc([ ], L, L).
> 
> conc( [X | L1], L2, [ X | L3] ) :- conc(L1, L2, L3).
> 
> add(X, L, [X|L]).
> 
> del( X, [X | Tail], Tail).
> 
> del (X, [ Y| Tail ], [ Y | Tail1] ) :- del(X, Tail, Tail1).
> 
> Member, conc and add work fine.  The del does not.  When I load the program using consul, I get an error that there is an operator excepted in line 12 (the last line.)  I don't see anything wrong.
> I should note that I did have similar problems with conc.  It cleared up after I corrected an error in member1 (I forgot the ] to close the fist list in the first clause of member1.

the code must be:

member1(X, [X | _Tail] ).
member1(X, [_Head | Tail] ) :- member1(X, Tail).

conc([ ], L, L).
conc( [X | L1], L2, [ X | L3] ) :- conc(L1, L2, L3).

add(X, L, [X|L]).

del( X, [X | Tail], Tail).
del(X, [ Y| Tail ], [ Y | Tail1] ) :- del(X, Tail, Tail1).

It is not allowd to have a space between the predicate_name and the open bracket.

-- 


Regards

Uwe
Lesta@t-online.de

