help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to improve the readability of (any) LISP or any highlevel functi


From: m_l_g3
Subject: Re: How to improve the readability of (any) LISP or any highlevel functional language to the level of FORTH ?
Date: Tue, 18 Jan 2011 14:55:58 -0800 (PST)
User-agent: G2/1.0

On Jan 1, 10:04 am, girosenth <girose...@india.com> wrote:
> How to improve the readability of (any) LISP or any highlevel
> functional language to the level of FORTH ?

...
>
> How do you make it readable ?
...
>
> (f (g (h (j (k (l ops)))...)))

(e
   (f
      (g (h i)
         (j k l)
      )
      (m (n o (p q))
         (r (s t) u)
)  )  )

The rule: if you don't see the closing paren moving the eyes down,
it's on the right.
But it either to the right or down, no other option.

Since closing parens are visually identical, there's no need to one
line per paren;
this is shown at the last line (yes, their visual and logical
orderings are different,
but they are identical parens otherwise worth only counting!).



> Is there a postfix functional language that also gets rid of parens
> and is not as primitive as FORTH or POSTSCRIPT ?

There is a prefix/infix one: Haskell with its ($) and (.) operators
and... well... monads.

As to Forth, you may try to layout control structures on the right,
as if RPN is not enough:

: MAX   2dup >      if
            drop    else
            nip     then
;

: foo
  10 0               do
     i 3 mod 0= if
        i .     then loop
;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]