Home

On 8/28/07, Stefan Niemann <stefan@3niemann.de> wrote:
> Hi,
>
> sorry that I'm relatively new to Python. But the syntax and semantics of
> Python already fascinate me, because I'm familiar with functional languages
> like Haskell.
>
> Is there a pattern matching construct in Python like (head : tail), meaning
> 'head' matches the first element of a list and 'tail' matches the rest? I
> could not find this in the Python documentation.
>
> Regards,
> Stefan
>
>

Python does not have haskell like pattern matching. Things are written
and done in a different way.

When working with lists, Python has a slice syntax (which is rather
more powerful than Haskells limited head->tail linked list syntax)
that you can use to chop a sequence up into various parts.

previous
next

Re: data abstraction vs encapsulation example needed
Re: Stream states questions
Re: virtual operator +
Re: how can i make a set with comparison function ?
Re: help with vector<vector<double>>
Rodzic Po Ludzku
Mam Marzenie
Mimo Wszystko
Fundacja Hobbit
Fundacja Iskierka