
Quinn Dunkan
... It is very natural to write in a somewhat functional style, especially in regards to sequence processing: higher order functions and listcomps provide the processing and its built in generators and iterator protocol provide some of the benefits of laziness. Its elementary pattern matching encourages you to return as many values from a function as you need and use zip() (another haskell steal) to iterate over parallel sequences (all pattern matches are irrefutable, though).
I'm confused... Python has pattern matching ? s.

On 11/05/05, Stijn De Saeger
Quinn Dunkan
wrote : ... It is very natural to write in a somewhat functional style, especially in regards to sequence processing: higher order functions and listcomps provide the processing and its built in generators and iterator protocol provide some of the benefits of laziness. Its elementary pattern matching encourages you to return as many values from a function as you need and use zip() (another haskell steal) to iterate over parallel sequences (all pattern matches are irrefutable, though).
I'm confused... Python has pattern matching ?
Well, we usually call it unpacking. You can only do it on sequences (maybe just tuples?), it looks like this: (x, y) = (1, 2) or this: x, y = 1, 2 -- Sam
participants (2)
-
Samuel Bronson
-
Stijn De Saeger