Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site mmintl.UUCP Path: utzoo!linus!philabs!pwa-b!mmintl!franka From: franka@mmintl.UUCP (Frank Adams) Newsgroups: net.lang Subject: Re: Reading programs left-to-right. (LONG) Message-ID: <597@mmintl.UUCP> Date: Tue, 13-Aug-85 15:03:36 EDT Article-I.D.: mmintl.597 Posted: Tue Aug 13 15:03:36 1985 Date-Received: Mon, 19-Aug-85 06:18:19 EDT References: <6571@boring.UUCP> <10984@rochester.UUCP> Reply-To: franka@mmintl.UUCP (Frank Adams) Organization: Multimate International, E. Hartford, CT Lines: 31 Summary: In article <10984@rochester.UUCP> quiroz@rochester.UUCP (Cesar Quiroz) writes: > Let's assume that a language >is worked around your suggestion of left-to-right preference (which could mean >that the value "surviving" an assignment is the rightmost one), then we might >have "directional" assignments (say "->" and "<-"), with neat and wizardesque >consequences: > > float x; > int i; > f1 (int arg); >or > f2 (float arg); > > /* assign value of i to x and call one of these functions */ > f1 (x<-i); /* remember, i survives to be passed to f1 */ >or > f2 (i->x); /* here we need a float, so we assign in the other order! */ The problem is, I would expect these to work the other way; that is, x<-i is a float, and i->x is an integer. I think this notation is inherently confusing. (But that never stopped language designers before :-) Actually, I think the left assignment is usually more natural. Most of the time, I don't say "now I want to compute 'b^2-4*a*c'; now what shall I call the result? How about 'discrim.'" Instead, I say, "Now I want to compute the discriminant, which is in the variable 'discrim'; now what is the formula for it? Ah, 'b^2-4*a*c'". I might want a right-pointing assignment operator to create a temporary variable; the type of the variable would be the type of the expression assigned to it.