Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cca!mirror!adelie!necntc!linus!philabs!pwa-b!mmintl!franka From: franka@mmintl.UUCP (Frank Adams) Newsgroups: comp.lang.c Subject: Re: swaps with arrays Message-ID: <2366@mmintl.UUCP> Date: Fri, 11-Sep-87 15:23:40 EDT Article-I.D.: mmintl.2366 Posted: Fri Sep 11 15:23:40 1987 Date-Received: Tue, 15-Sep-87 04:01:39 EDT References: <2376@zeus.TEK.COM> <110@umigw.MIAMI.EDU> <1955@sol.ARPA> <111@umigw.MIAMI.EDU> Reply-To: franka@mmintl.UUCP (Frank Adams) Organization: Multimate International, E. Hartford, CT. Lines: 20 In article <111@umigw.MIAMI.EDU> steve@umigw.UUCP (steve emmerson) writes: >Although I can see the validity of this argument (and I hope I've >restated it correctly) I would argue that the swapping of arrays does >have valid meaning -- namely an element-by-element exchange of values. >This causes each array to become the other and, to me at least, is a >straightforward consequence of swap semantics. As such, this >functionality should be included in any generic swap routine. The point is that a generic facility should work for all objects in some category. The appropriate category for a swap macro is that of *assignable* objects in the language. And in C, as the result of a series of decisions which seemed like good ideas at the time, arrays are not assignable. It is true that the semantics of the assignment of arrays is obvious and straightforward (I think -- there may be some traps hiding there somewhere). This is beside the point. The point is that C doesn't support it. -- Frank Adams ihnp4!philabs!pwa-b!mmintl!franka Ashton-Tate 52 Oakland Ave North E. Hartford, CT 06108