Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!lll-crg!lll-lcc!qantel!hplabs!sdcrdcf!psivax!csun!lkw From: lkw@csun.UUCP (Larry Wake) Newsgroups: net.lang Subject: Re: Multiple assignments Message-ID: <220@csun.UUCP> Date: Thu, 15-May-86 20:27:50 EDT Article-I.D.: csun.220 Posted: Thu May 15 20:27:50 1986 Date-Received: Tue, 20-May-86 06:49:28 EDT References: <501@brl-smoke.ARPA> <797@bentley.UUCP> <1455@mmintl.UUCP> Reply-To: lkw@csun.UUCP (Larry Wake) Organization: California State University, Northridge Lines: 27 Keywords: In article <1455@mmintl.UUCP> franka@mmintl.UUCP (Frank Adams) writes: >This bothers me somewhat too. I do have a suggestion for how to deal with >it: have a "multi-assignment" operator. Supposing that "$" is being used >for this operator, then to set both "a" and "b" to zero, one would write >"a $ b = 0", rather than "a = b = 0", as C does. This bothers me somewhat (where have I heard this before?) -- your "$" operator is actually instructing ANOTHER operator to have an attribute it doesn't usually have (at least in your proposed implementation). In other words, in "b = 0", the "=" operation would NOT return a value, but in "a $ b = 0", the "=" operation WOULD return a value, due only to context, which I thought was what you were trying to avoid in the first place. The solution (if a solution is really necessary, and I don't think one is) would be to change the place in your example where a special operator is needed. In this case, "$" would be a special type of assignment operator: one that returned a value. Your example would be "a = b $ 0", indicating that the assignment of 0 to b should return a value, which can then be assigned to a. The plain old "=" would never return a value, and whatever lint-like thingy you run over your program will be perfectly happy. -- Larry Wake uucp: {ihnp4 | hplabs | psivax}!csun!lkw CSUN Computer Center BITNET: RETPLKW@CALSTATE Northridge, CA 91330 ARPA: RETPLKW%CALSTATE@WISCVM.WISC.EDU "He's no fun, he fell right over."