Op donderdag 15 augustus 2013 13:42:40 UTC+2 schreef Jason Grout: > > On 8/15/13 5:24 AM, Jean Dubois wrote: > > pi = lambda x: pari(x).primepi() > > lambda is a way of making a short function without having to name it. > The result of the above line is that pi(x) will call pari(x).primepi(). > As David mentioned, the real work is done by Pari here. > > More technical documentation for lambda functions is here: > http://docs.python.org/2/tutorial/controlflow.html#lambda-forms > > The documentation on this url refers to Python's use of lambda. Unfortunately at this moment it is not totally clear to me what the inner relationships are between Python and Sage, therefore I don't know what is relevant for Python and what is relevant for Sage. What is the utility of "anonymous functions"? In the example I got from "adventures in group theory" the function is after all named "pi" so it's no longer anonymous? Maybe some one could show the benefit of using this lamba-syntax by defining a function "classically" and by defining it "the lambda way"
thanks jean > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/groups/opt_out.