while (a=b()) ...

Quinn Dunkan quinn at euro.ugcs.caltech.edu
Thu May 13 19:14:53 EDT 1999


On 11 May 1999 12:55:43 GMT, Andrew Clover <esuzm at primrose.csv.warwick.ac.uk>
wrote:
> Indeed. I was not suggesting it for Python specifically, just in general
>as something I'd like to see. Being new to the group and having access to
>only a limited archive of back postings, I hadn't seen this discussion
>before. Personally I want to give Python big plaudits for allowing:
>
>  (a, b)= (b, a)
>
> something which I always wanted a language to do. Now, if only I could
>define a function in the form:
>
>  foo= fn (x, y) to (print x+y; print x*y)
>
> I'd be happy. Well, relatively happy. Happier than with the current lambda
>form syntax... I get the feeling I could be treading past ground again,
>though... :-)

haskell (www.haskell.org):

foo x y = (x + y, x * y)

Also, if you like tuple unpacking, otherwise known as pattern matching,
haskell has much more complete pattern matching abilities (in fact, function
application is done with pattern matching).

As Tim has mentioned, if you're looking for a functional language, python
is not that language :)




More information about the Python-list mailing list