Article View: comp.lang.functional
Article #1145Re: How to improve the readability of (any) LISP or any highlevel functional language to the level of FORTH ?
From: m_l_g3
Date: Tue, 18 Jan 2011 22:55
Date: Tue, 18 Jan 2011 22:55
51 lines
2656 bytes
2656 bytes
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
;
Technical Details
Message-ID:
<5121f8b1-a8d2-4587-a45e-387469762668@m13g2000yqb.googlegroups.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!m13g2000yqb.googlegroups.com!not-for-mailReferences:
<80ceeca0-1d32-47d1-ba96-feb4d9729c3a@v17g2000yqv.googlegroups.com>Show Full Headers
Complete Article Headers
X-Google-Thread: ee3de009bc,1641de092071599d X-Google-Attributes: gidee3de009bc,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!m13g2000yqb.googlegroups.com!not-for-mail From: m_l_g3 <m_l_g3@yahoo.com> Newsgroups: comp.lang.functional,comp.lang.lisp,gnu.emacs.help,comp.lang.forth,comp.lang.prolog 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) Organization: http://groups.google.com Lines: 53 Message-ID: <5121f8b1-a8d2-4587-a45e-387469762668@m13g2000yqb.googlegroups.com> References: <80ceeca0-1d32-47d1-ba96-feb4d9729c3a@v17g2000yqv.googlegroups.com> NNTP-Posting-Host: 109.205.252.157 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1295391359 10770 127.0.0.1 (18 Jan 2011 22:55:59 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 18 Jan 2011 22:55:59 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: m13g2000yqb.googlegroups.com; posting-host=109.205.252.157; posting-account=RUHbqgkAAABl4OyE6wbxcc3SwaDEov4g User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.45 Safari/534.13,gzip(gfe)