Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!rpi!brutus.cs.uiuc.edu!jarthur!uci-ics!ucla-cs!coleman From: coleman@maui.cs.ucla.edu (Michael Coleman) Newsgroups: comp.lang.prolog Subject: Re: incrementing values Message-ID: <31462@shemp.CS.UCLA.EDU> Date: 2 Feb 90 04:45:14 GMT References: <17467@megaron.cs.arizona.edu> Sender: news@CS.UCLA.EDU Reply-To: coleman@cs.ucla.edu (Michael Coleman) Organization: UCLA Computer Science Department Lines: 22 In article <17467@megaron.cs.arizona.edu> debray@cs.arizona.edu (Saumya K. Debray) writes: >This is an excerpt from an article posted recently to another newsgroup: >| increment(Variable) :- >| retract(value(Variable, OldValue)), >| NewValue is OldValue + 1, >| assert(value(Variable, NewValue)). >Comments? I saw this in the other newsgroup. My jaw dropped when I read it. Incredible! Kind of makes you wonder how this poster would implement, say, quicksort, or nested "for" loops in Prolog. Every once in a while something comes along to help us remember why languages like COBOL, Fortran, and friends still reign supreme. Sigh. --Mike %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% try. %% "When at first you try :- try. %% don't succeed, ..." (coleman@cs.ucla.edu)