[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: postfix




   Date: Mon, 3 Dec 2001 12:17:05 -0500 (EST)
   From: "S. Alexander Jacobson" <alex@shop.com>
   ...
   On 30 Nov 2001 jmarshall@mak.com wrote:
   > "S. Alexander Jacobson" <alex@shop.com> writes:
   > > What about postfix?
   > You can rearrange its indentation and whitespace, but you can't
   > rearrange it to read left to right.
   
   Perhaps you can. Or perhaps you prefer a concatenative prefix language.
   You could do a transformation to prefix that included reversing arguments.
   So:
   concat
     [2 3 4 5]
     map
       [add 1]
       range 1 10
   
   would be the same as postfix.:
   [2 3 4 5] [add 1] 1 10 range map concat

This raises an interesting question: does anyone know whether
there are any Forth programmers out there who structure their
code visually using "upside-down" indenting such as

      [2 3 4 5]
        [1 add]
        1 10 range
      map
    concat

?  (I have not seen such indenting in the printed Forth code
examples I have come across.)

--Guy