🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #1662

Re: not(X=Y) and side effects

#1662
From: Denys Duchier
Date: Wed, 12 Dec 1990 20:43
14 lines
1038 bytes
In article <5398@rex.cs.tulane.edu> feldman@rex.cs.tulane.edu (Damon Feldman) writes:
 >   I was writing a small prolog program, and I had use for the following
 >   predicate:
 >
 >   notequal(X,Y) :- nonvar(X),nonvar(Y),X=Y,!,fail.
 >   notequal(X,_) :- var(X),!,fail.
 >   notequal(_,Y) :- var(Y),!,fail.
 >   notequal(_,_).

Why not just:

notequal(X,Y) :- nonvar(X),nonvar(Y),X\=Y.

--Denys
Technical Details
Message-ID: <DUCHIER.90Dec12154306@albania.cs.yale.edu>
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!yale!quasi-eli!cs.yale.edu!newsbase!duchier
References: <5398@rex.cs.tulane.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!yale!quasi-eli!cs.yale.edu!newsbase!duchier
From: duchier@cs.yale.edu (Denys Duchier)
Newsgroups: comp.lang.prolog
Subject: Re: not(X=Y) and side effects
Message-ID: <DUCHIER.90Dec12154306@albania.cs.yale.edu>
Date: 12 Dec 90 20:43:06 GMT
References: <5398@rex.cs.tulane.edu>
Sender: news@cs.yale.edu
Reply-To: duchier-denys@cs.yale.edu
Organization: Computer Science, Yale University, New Haven, CT 06520-2158
Lines: 14
Nntp-Posting-Host: albania.ai.cs.yale.edu
In-reply-to: feldman@rex.cs.tulane.edu's message of 12 Dec 90 19:15:54 GMT