help-gnu-emacs
[Top][All Lists]
Advanced

[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: Jerome Baum
Subject: Re: How to improve the readability of (any) LISP or any highlevel functional language to the level of FORTH ?
Date: Sun, 2 Jan 2011 16:14:33 +0100
User-agent: MicroPlanet-Gravity/3.0.4

In article <ce0f5c3b-bc71-4868-8d2b-5495583ccfa8
@w18g2000vbe.googlegroups.com>, lanx.perl@googlemail.com says...
> 
> Paul Rubin schrieb:
> 
> > That is pretty ugly; in Haskell you could write
> >
> >    my_list = [1, 1, 1, 1, 2, 3, 3, 1, 1, 4, 5, 5, 5, 5]
> >    main = print [head xs | xs <- group my_list]
> 
> does this really produce the desired output?
> Will the second 1 really be printed?
> 
> And why do you guys switch to operate on digits instead of strings?

http://codepad.org/eGFuJrHZ

import List
my_list = ["one", "one", "one", "one", "two", "three", "three", "one", 
"one", "four", "five", "five", "five", "five"]
main = print [head xs | xs <- group my_list]

Output:
["one","two","three","one","four","five"]

Works fine for me...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]