Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84; site macbeth.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!lll-crg!dual!qantel!ihnp4!mhuxn!mhuxr!ulysses!allegra!princeton!astrovax!fisher!macbeth!haahr From: haahr@macbeth.UUCP (Paul Haahr) Newsgroups: net.lang Subject: Re: Reading programs left-to-right. Message-ID: <131@macbeth.UUCP> Date: Mon, 12-Aug-85 19:21:12 EDT Article-I.D.: macbeth.131 Posted: Mon Aug 12 19:21:12 1985 Date-Received: Sat, 17-Aug-85 05:54:14 EDT References: <6571@boring.UUCP> Organization: Princeton University Lines: 31 In article <6571@boring.UUCP> Jack Jansen (mcvax!jack) writes: > Why do most programming languages do assignments like > > This has two major disadvantages over > > in my opinion. > ... > I remember seeing a language with the second type assigments once, > but it hasn't seemed to catch on. I can think of one in which a similar syntax has caught on. Consider: echo 3 > a (a = 3) echo 5 > b (b = 5) cat a | add b > c (c = 8) cat a | sub b | tee d | add `echo 4` > e (e = (d = a - b) + 4) where add and sub are filters that numerically add (substract) the values from the file presented as an argument to the standard input values. Arithmetic is not the typical use of of the shell, but the pipe notation is flexible enough (because all it really is is another notation for calling functions, as is operator infix notation). I like shell/pipe syntax better (as a rule of thumb) than operator notation, and agree that left to right could be more intuitive than right to left. However, it will take more than slight notational convenience to change the world. my suggestion: write a good, general purpose programming language that uses this notation. use it for a while. if you and other people like it, great. if not, all you've done is invented another dvorak keyboard. -- Paul Haahr ..!princeton!macbeth!haahr