Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!rutgers!rochester!quiroz From: quiroz@cs.rochester.edu (Cesar Quiroz) Newsgroups: comp.lang.c Subject: Re: swaps with arrays Message-ID: <1955@sol.ARPA> Date: Tue, 8-Sep-87 14:55:00 EDT Article-I.D.: sol.1955 Posted: Tue Sep 8 14:55:00 1987 Date-Received: Wed, 9-Sep-87 06:16:45 EDT References: <2376@zeus.TEK.COM> <110@umigw.MIAMI.EDU> Reply-To: quiroz@ROCHESTER.UUCP (Cesar Quiroz) Organization: U of Rochester, CS Dept, Rochester, NY Lines: 31 Summary: Expires: Sender: Followup-To: From article <110@umigw.MIAMI.EDU> (steve@umigw.UUCP (steve emmerson)): :In article <1354@dataio.Data-IO.COM> bright@dataio.Data-IO.COM (Walter :Bright) wrote: -- classic stuff about generic swaps edited out -- : :Causing Dan Tilque to wonder [bear with me ;-)] (in article :<2376@zeus.TEK.COM> dant@tekla.UUCP): :+-------- :|Can someone tell me why every one expects (or requires) a swap macro to :|work with arrays? The reason that they don't is that an array name is :|a constant and not an object. ... :+-------- : :Well, I can't speak for everyone ;-), but if I was given a generic swap :routine that only worked on a subset of all possible data types ... :well, I might consider it very useful, but I wouldn't consider it :generic. What does it have to do with genericity (generic-hood?)? Dan Tilque's comment can be seen better in the light of another example: what would you like swap(1, 2); to mean? It seems to me that he has a clear point: C arrays are constants, `swap' should act on (the values of) variables. -- Cesar Augusto Quiroz Gonzalez Department of Computer Science {allegra|seismo}!rochester!quiroz University of Rochester or Rochester, NY 14627 quiroz@cs.rochester.edu