Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!pwa-b!mmintl!franka From: franka@mmintl.UUCP (Frank Adams) Newsgroups: net.lang Subject: Re: Multiple assignments Message-ID: <1482@mmintl.UUCP> Date: Tue, 20-May-86 18:32:04 EDT Article-I.D.: mmintl.1482 Posted: Tue May 20 18:32:04 1986 Date-Received: Fri, 23-May-86 23:55:52 EDT References: <1455@mmintl.UUCP> <825@bentley.UUCP> Reply-To: franka@mmintl.UUCP (Frank Adams) Organization: Multimate International, E. Hartford, CT Lines: 21 In article <825@bentley.UUCP> kwh@bentley.UUCP writes: >In article <1455@mmintl.UUCP> franka@mmintl.UUCP (Frank Adams) writes: >>... Supposing that "$" is being used for this ["multi-assignment"] operator, >>then to set both "a" and "b" to zero, one would write "a $ b = 0", rather >>than "a = b = 0", as C does.... >>On the other hand, if your language supports argument passing by address, >>it permits an output argument to be multiply assigned; something which >>assignment-with-value does not support. > >What do you mean by this? I don't see how this operator allows you to do >anything that simple assignment doesn't. Examples? Well, in C it doesn't, since C supports call by value only. In PL/I, for example, one could write a procedure (called, say, getlin) which would read a line from a file; it has four parameters -- a file, a buffer, the length of that buffer, and the number of characters read. With a "$" operator, one could then write something like "getlin(fp, buff, buflen, actlen$lenread);"; without it, one must use a separate assignment. Frank Adams ihnp4!philabs!pwa-b!mmintl!franka Multimate International 52 Oakland Ave North E. Hartford, CT 06108