A Pythonista's Impressions of Erlang

Raimo Niskanen <>
Wed Jan 12 09:33:00 CET 2005


I think either string:stubstr/2,3 (that can operate on
any-element-lists as well), or lists:split/2 can do 
what you want.

By the way, the 'string' module has got a lot of
C-style string handling functions. Many of them do 
not bother about the list elements being characters.

When doing a quick readthrough of 'string' it seems as
words/1,2, sub_word/2,3, left/2,3, and right/2,3
require that the elements are integers. I do not 
see why this requirement could not be relaxed.



 (Corrado Santoro) writes:

> Dominic Williams wrote:
> > Given what is already in the lists module,
> >>
> >> a="Hello, World"
> >> a[5:-3] --> ", Wo"
> > slice("Hello, World", 5, -3) -> ...
> > must be a one- or two-liner.
> why not including such a function in "lists"?
> 
> > Why bother with the syntactic sugar?
> I agree :-))
> 
> Cheers,
> --Corrado
> 
> -- 
> ======================================================
> Eng. Corrado Santoro, Ph.D.
> 
> University of Catania - Engineering Faculty
> Department of Computer Science and
> Telecommunications Engineering
> Viale A. Doria, 6 - 95125 CATANIA (ITALY)
> 
> Tel: +39 095 7382380           Fax: +39 095 7382397
>       +39 095 7382365
>       +39 095 7382364
> 
> EMail: 
> Personal Home Page:
>              http://www.diit.unict.it/users/csanto
> 
> NUXI Home Page:
>              http://nuxi.iit.unict.it
> ======================================================
> 

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list