From jdjohnston2@juno.com Tue Feb 20 03:10:45 2001
Received: from m7.jersey.juno.com (m7.jersey.juno.com [64.136.16.70])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f1K2AjZ17572
	for <prolog@swi.psy.uva.nl>; Tue, 20 Feb 2001 03:10:45 +0100 (MET)
Received: from cookie.juno.com by cookie.juno.com for <"agNVsrKwtOEeaIQ2GG4oquy13djbOV/RFlbL4tLRiIiPa5bxovmI/g==">
Received: (from jdjohnston2@juno.com)
 by m7.jersey.juno.com (queuemail) id FWPGUKBP; Mon, 19 Feb 2001 21:10:26 EST
To: ok@atlas.otago.ac.nz
Cc: prolog@swi.psy.uva.nl
Date: Mon, 19 Feb 2001 21:14:41 -0500
Subject: Re: [SWIPL] keysort
Message-ID: <20010219.211441.-173975.0.jdjohnston2@juno.com>
X-Mailer: Juno 5.0.27
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Juno-Line-Breaks: 0-8,10-28
From: Jonathan D Johnston <jdjohnston2@juno.com>

On Tue, 20 Feb 2001 11:33:53 +1300 (NZDT) ",
Richard A. O'Keefe" <ok@atlas.otago.ac.nz> wrote:
---------- >8 snip 8<-------------------------------
>     last_keys([], []) :- !.                % Green cut for inverse use
>     last_keys([L|Ls], [K-L|KLs]) :-
>         last(K, L),
>         last_keys(Ls, KLs).
> 
---------- >8 snip 8<-------------------------------
>     triple_keys([], []) :- !.                % Green cut for inverse
use
>     triple_keys([L|Ls], [K-L|KLs]) :-
>         L = [_,_,K],
>         triple_keys(Ls, KLs).
---------- >8 snip 8<-------------------------------

Dear Richard A. O'Keefe,

Would you explain your use of cut in the above predicates?
Also, why do you refer to them as "Green" cuts? During my
(limited) testing of these predicates, I didn't see any difference
with or without the cut. For those more experienced with
Prolog, this is probably an obvious question. For myself, though,
I must confess that I am still sometimes confused by when
to use cut.

Thank you for your insightful contributions to this mailing list.
I always look forward to reading your postings.

Jonathan D Johnston
________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
http://dl.www.juno.com/get/tagj.

