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
;