On Fri, 17 Dec 2004 15:58:09 -0800, Charlie Taylor <[EMAIL PROTECTED]> wrote:
>
> I find that I use lambda functions mainly for callbacks to things like
> integration or root finding routines as follows.
> 
> flow = integrate(lambda x: 2.0*pi * d(x)* v(x) * sin(a(x)),xBeg, xEnd) 
> 
> root = findRoot(xBeg, xEnd, 
>        lambda x: y2+ lp*(x-x2) -wallFunc( x )[0], tolerance=1.0E-15)
> 
> I have tried using named functions instead of using lambda functions,
> however, I always end up with a convoluted, hard to follow mess.
> 
> Is there a better solution than a lambda in the above situations?

  Yes.  Your code is horribly unreadable.  You should not even be 
allowed near a computer.  Your lambdas, in order of definition,
should obviously be named twicePiTimesDxVxTimesSinAx and
y2PlusLpTimesTheQuantityXLessX2LessWallFuncXOfZero.

  Please be more careful and attentive in the future.

  Jp
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to