🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #812

Re: NOT Educating FORTRAN programmers to use C

#812
From: David Lee Matuszek
Date: Fri, 19 Jan 1990 21:06
30 lines
1746 bytes
In article <12950@cbnewsc.ATT.COM> res@cbnewsc.ATT.COM (Rich Strebendt) writes:

>  Also, it should also be kept in mind that,
>while it is fun to figure out how to optimize very exotic constructs,
>the most frequently occuring construct in any programming language is
>equivalent to the construct x += 1

Er, not quite *any* programming language.  I have been programming
professionally in Prolog for the last five years, and I need to do
this sort of thing maybe once or twice a year.

BTW, here's how to do it:

	increment(Variable) :-
		retract(value(Variable, OldValue)),
		NewValue is OldValue + 1,
		assert(value(Variable, NewValue)).

	..., increment(x), ...

but as this makes two modifications to the database and is therefore
pretty expensive (not to mention poor style), you don't want to do it
too often.

Moral:  "Toto, I don't think we're in Kansas anymore."

-- Dave Matuszek (dave@prc.unisys.com)
-- Unisys Corp. / Paoli Research Center / PO Box 517 / Paoli PA  19301
-- Any resemblance between my opinions and those of my employer is improbable.
  << Those who fail to learn from Unix are doomed to repeat it. >>
Technical Details
Message-ID: <12576@burdvax.PRC.Unisys.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!aplcen!haven!udel!burdvax!dave
References: <15623@haddock.ima.isc.com> <8960003@hpfcso.HP.COM> <1990Jan17.042608.447@esegue.segue.boston.ma.us> <12950@cbnewsc.ATT.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!aplcen!haven!udel!burdvax!dave
From: dave@PRC.Unisys.COM (David Lee Matuszek)
Newsgroups: comp.lang.misc
Subject: Re: NOT Educating FORTRAN programmers to use C
Message-ID: <12576@burdvax.PRC.Unisys.COM>
Date: 19 Jan 90 21:06:30 GMT
References: <15623@haddock.ima.isc.com> <8960003@hpfcso.HP.COM> <1990Jan17.042608.447@esegue.segue.boston.ma.us> <12950@cbnewsc.ATT.COM>
Sender: news@PRC.Unisys.COM
Organization: Unisys Corporation, Paoli Research Center; Paoli, PA
Lines: 30