🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #606

Re: Escape from strong typing (was: swap(x,y))

#606
From: Doug Gwyn
Date: Sat, 02 Sep 1989 22:49
9 lines
1127 bytes
In article <14500@haddock.ima.isc.com> karl@haddock.ima.isc.com (Karl Heuer) writes:
>Btw, it wouldn't have worked to write "*(hack *)&x" since the implementation
>passed arguments in registers; taking the address forced a store to memory.

That's in fact what I had in mind when I implied that C has existing tools
that can do the job.  The particular implementation didn't need to allocate
actual memory for the operation; presumably it did so because its optimizer
wasn't sufficiently clever.  (I assume that this would have been coded as a
macro, not as a function call.)
Technical Details
Message-ID: <10911@smoke.BRL.MIL>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!haven!adm!smoke!gwyn
References: <MYwDEFy00WB842JEUx@andrew.cmu.edu> <8350@boring.cwi.nl> <14479@haddock.ima.isc.com> <1545@l.cc.purdue.edu> <10897@smoke.BRL.MIL> <14500@haddock.ima.isc.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!haven!adm!smoke!gwyn
From: gwyn@smoke.BRL.MIL (Doug Gwyn)
Newsgroups: comp.lang.misc
Subject: Re: Escape from strong typing (was: swap(x,y))
Message-ID: <10911@smoke.BRL.MIL>
Date: 2 Sep 89 22:49:21 GMT
References: <MYwDEFy00WB842JEUx@andrew.cmu.edu> <8350@boring.cwi.nl> <14479@haddock.ima.isc.com> <1545@l.cc.purdue.edu> <10897@smoke.BRL.MIL> <14500@haddock.ima.isc.com>
Reply-To: gwyn@brl.arpa (Doug Gwyn)
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 9