#4677: Plotting lambda functions
----------------------+-----------------------------------------------------
 Reporter:  kcrisman  |        Owner:  was       
     Type:  defect    |       Status:  new       
 Priority:  minor     |    Milestone:  sage-3.2.2
Component:  graphics  |   Resolution:            
 Keywords:            |  
----------------------+-----------------------------------------------------
Comment (by kcrisman):

 Replying to [comment:1 jason]:
 > Sure, it probably shouldn't work:
 > plot expects that when it feeds "a" a number (like a(2)), a number
 should be returned.  Instead, a function is returned.

 I guess my point was that I think one can catch this and use it.  Unless
 for some reason this is not desired, like some MS Word "guesses" at fixing
 mistakes, it is the sort of thing that one can do
 {{{
 sage: f=x^2
 sage: a=lambda x: f
 sage: a(2)
 x^2
 sage: a=a(x)
 sage: a(2)
 4
 }}}
 so that in principle upon a TypeError, one could try letting func=func(x)
 and then do float(func(point)).

 But I don't have time to try that for a few more days.  And maybe there is
 some internal reason not to do this... but I don't think so, because the
 result of plotting these is the empty plot otherwise, and one would
 reraise the exception if this still caused a TypeError.  Can you think of
 anything where this would not raise an exception but still lead to bad
 behavior?  I've seen weirder things...

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4677#comment:2>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to