C#3.0 and lambdas
Christophe
chris.cavalaria at free.fr
Wed Sep 21 09:24:29 EDT 2005
Fredrik Lundh a écrit :
> Christophe wrote:
>
>
>>> def drawline(p1, p2):
>>> # draw a line from p1 to p2
>>> foo(*p1)
>>> bar(*p2)
>>>
>>
>>That one is stupid. I don't see how you can make it work without some
>>global storing the p1 information in foo which I would consider as very
>>ugly code.
>
>
> if you cannot see how that can work, you clearly haven't done much graphics
> programming in your days...
You should probably notice that graphics library have changed a lot in
the last 20 years. Also, that one was an example but it could have been :
def draw_circle(c, p):
"""Draws a circle centered on c and which goes through p"""
pass
More information about the Python-list
mailing list