[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: |
w_a_x_man |
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) |
User-agent: |
G2/1.0 |
On Jan 1, 5:56 pm, The Quiet Center <thequietcen...@gmail.com> wrote:
> On Jan 1, 11:08 am, Nathan <nbeen...@gmail.com> 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.
> 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.
>
> Example:
> ?- compress([a,a,a,a,b,c,c,a,a,d,e,e,e,e],X).
> X = [a,b,c,a,d,e]
>
"aaaabccaadeeee".squeeze
==>"abcade"
p=nil; %w(a a a b c c a a d e e e).select{|x| x!=p && p=x}
==>["a", "b", "c", "a", "d", "e"]
- Re: How to improve the readability of (any) LISP or any highlevel functional language to the level of FORTH ?, (continued)
- Re: How to improve the readability of (any) LISP or any highlevel functional language to the level of FORTH ?, The Quiet Center, 2011/01/01
- Re: How to improve the readability of (any) LISP or any highlevel functional language to the level of FORTH ?, Jan Burse, 2011/01/01
- Re: How to improve the readability of (any) LISP or any highlevel functional language to the level of FORTH ?, LanX, 2011/01/01
- Re: How to improve the readability of (any) LISP or any highlevel functional language to the level of FORTH ?, LanX, 2011/01/01
- Re: How to improve the readability of (any) LISP or any highlevel functional language to the level of FORTH ?, Nathan, 2011/01/02
- Re: How to improve the readability of (any) LISP or any highlevel functional language to the level of FORTH ?, Paul Rubin, 2011/01/02
- Re: How to improve the readability of (any) LISP or any highlevel functional language to the level of FORTH ?, LanX, 2011/01/02
- Re: How to improve the readability of (any) LISP or any highlevel functional language to the level of FORTH ?, Jerome Baum, 2011/01/02
- Re: How to improve the readability of (any) LISP or any highlevel functional language to the level of FORTH ?, Paul Rubin, 2011/01/02
- Re: How to improve the readability of (any) LISP or any highlevel functional language to the level of FORTH ?, w_a_x_man, 2011/01/02
- Re: How to improve the readability of (any) LISP or any highlevel functional language to the level of FORTH ?,
w_a_x_man <=
- Re: How to improve the readability of (any) LISP or any highlevel functional language to the level of FORTH ?, LanX, 2011/01/03
- Re: How to improve the readability of (any) LISP or any highlevel functional language to the level of FORTH ?, Frank GOENNINGER, 2011/01/02
- Re: How to improve the readability of (any) LISP or any highlevel functional language to the level of FORTH ?, w_a_x_man, 2011/01/07
- Re: How to improve the readability of (any) LISP or any highlevelfunctional language to the level of FORTH ?, WJ, 2011/01/09
- Re: How to improve the readability of (any) LISP or any highlevel functional language to the level of FORTH ?, Didier Verna, 2011/01/03
- Re: How to improve the readability of (any) LISP or any highlevel functional language to the level of FORTH ?, Tim Harig, 2011/01/03
- Re: How to improve the readability of (any) LISP or any highlevel functional language to the level of FORTH ?, rusi, 2011/01/04
- Re: How to improve the readability of (any) LISP or any highlevel functional language to the level of FORTH ?, D Herring, 2011/01/04
- Re: How to improve the readability of (any) LISP or any highlevel functional language to the level of FORTH ?, Tim Harig, 2011/01/04
- Re: How to improve the readability of (any) LISP or any highlevel functional language to the level of FORTH ?, Tim Bradshaw, 2011/01/04