From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: w_a_x_man Newsgroups: gmane.emacs.help 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 22:59:32 -0800 (PST) Organization: http://groups.google.com Message-ID: <617eae48-d532-4eb1-aefa-b54ca3d23654@r19g2000prm.googlegroups.com> References: <80ceeca0-1d32-47d1-ba96-feb4d9729c3a@v17g2000yqv.googlegroups.com> <87pqsgk8v9.fsf@kuiper.lan.informatimago.com> <9e7a7683-a92a-4e88-a6f1-9e6a6bd2f057@z9g2000yqz.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1293989055 3864 80.91.229.12 (2 Jan 2011 17:24:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 2 Jan 2011 17:24:15 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 02 18:24:11 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PZRf8-0003nc-5I for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Jan 2011 18:24:10 +0100 Original-Received: from localhost ([127.0.0.1]:47486 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PZRf7-00036p-Cc for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Jan 2011 12:24:09 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!r19g2000prm.googlegroups.com!not-for-mail Original-Newsgroups: comp.lang.functional, comp.lang.lisp, gnu.emacs.help, comp.lang.forth, comp.lang.prolog Original-Lines: 30 Original-NNTP-Posting-Host: 209.42.179.244 Original-X-Trace: posting.google.com 1293951572 4185 127.0.0.1 (2 Jan 2011 06:59:32 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 2 Jan 2011 06:59:32 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: r19g2000prm.googlegroups.com; posting-host=209.42.179.244; posting-account=vf5QpQoAAADgh9WOa2uZtoS1yoyJdEBw User-Agent: G2/1.0 X-HTTP-UserAgent: Opera/9.80 (Windows NT 5.1; U; en) Presto/2.6.30 Version/10.63,gzip(gfe) Original-Xref: usenet.stanford.edu comp.lang.functional:69069 comp.lang.lisp:297082 gnu.emacs.help:183838 comp.lang.forth:160251 comp.lang.prolog:44000 X-Mailman-Approved-At: Sun, 02 Jan 2011 12:21:05 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:78059 Archived-At: On Jan 1, 5:56=A0pm, The Quiet Center wrote: > On Jan 1, 11:08=A0am, Nathan wrote: > > > If you want a easy to read self-documenting functional language, look > > into Ruby. I know personally that Ruby syntax was a big turn off to me > > for several weeks (kind of like Lisp) but once you learn it, it > > becomes the easiest to read of any programming language I've ever > > experimented with. No contest. > > Well, Python was chosen over Ruby for MIT's rework of their intro to > cs course because Python is multi-paradigm, whereas Ruby claims > everything is an object. > > How would you code this simple list compression problem in Ruby: > > 1.08 (**) Eliminate consecutive duplicates of list elements. > =A0 =A0 If a list contains repeated elements they should be replaced with > a single copy of the element. The order of the elements should not be > changed. > > =A0 =A0 Example: > =A0 =A0 ?- compress([a,a,a,a,b,c,c,a,a,d,e,e,e,e],X). > =A0 =A0 X =3D [a,b,c,a,d,e] > "aaaabccaadeeee".squeeze =3D=3D>"abcade" p=3Dnil; %w(a a a b c c a a d e e e).select{|x| x!=3Dp && p=3Dx} =3D=3D>["a", "b", "c", "a", "d", "e"]