Article View: comp.lang.functional
Article #1191Re: How to improve the readability of (any) LISP or any highlevel functional language to the level of FORTH ?
From: LanX
Date: Sun, 02 Jan 2011 04:04
Date: Sun, 02 Jan 2011 04:04
8 lines
2120 bytes
2120 bytes
> in Perl:
> DB<1> my $l; print grep { $l = $_ if $_ ne $l } (a,a,a,a,b,c,c,a,a,d,e,e,e,e);
> abcade
The same more explicit and less buggy
grep { if ($_ ne $l) { $l = $_ ; 1 } } LIST
Technical Details
Message-ID:
<3bd9f0cb-a400-4332-adf2-27cddb1a2db6@l7g2000vbv.googlegroups.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!l7g2000vbv.googlegroups.com!not-for-mailReferences:
<80ceeca0-1d32-47d1-ba96-feb4d9729c3a@v17g2000yqv.googlegroups.com> <87pqsgk8v9.fsf@kuiper.lan.informatimago.com> <ca15d8c3-86db-46fd-b35f-1a2596475769@n32g2000pre.googlegroups.com> <9e7a7683-a92a-4e88-a6f1-9e6a6bd2f057@z9g2000yqz.googlegroups.com> <aa0e6de9-26c7-4a98-93af-24d0188a3506@m35g2000vbn.googlegroups.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 107f24,1641de092071599d X-Google-NewGroupId: yes X-Google-Thread: f4fd2,1641de092071599d X-Google-NewGroupId: yes X-Google-Thread: 103b8b,1641de092071599d X-Google-NewGroupId: yes X-Google-Thread: fd7c9,1641de092071599d X-Google-NewGroupId: yes X-Google-Attributes: gid4e63bbc566,gidf85ca024c1,gid39ae015015,gid2832dde05d,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!l7g2000vbv.googlegroups.com!not-for-mail From: LanX <lanx.perl@googlemail.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: Sat, 1 Jan 2011 20:04:27 -0800 (PST) Organization: http://groups.google.com Lines: 8 Message-ID: <3bd9f0cb-a400-4332-adf2-27cddb1a2db6@l7g2000vbv.googlegroups.com> References: <80ceeca0-1d32-47d1-ba96-feb4d9729c3a@v17g2000yqv.googlegroups.com> <87pqsgk8v9.fsf@kuiper.lan.informatimago.com> <ca15d8c3-86db-46fd-b35f-1a2596475769@n32g2000pre.googlegroups.com> <9e7a7683-a92a-4e88-a6f1-9e6a6bd2f057@z9g2000yqz.googlegroups.com> <aa0e6de9-26c7-4a98-93af-24d0188a3506@m35g2000vbn.googlegroups.com> NNTP-Posting-Host: 89.14.213.187 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1293941067 10497 127.0.0.1 (2 Jan 2011 04:04:27 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 2 Jan 2011 04:04:27 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l7g2000vbv.googlegroups.com; posting-host=89.14.213.187; posting-account=W9fpQwoAAADZYmkl-8sXk1VPxG3rq-Pd User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.0.19) Gecko/2010040118 Ubuntu/8.10 (intrepid) Firefox/3.0.19,gzip(gfe)