I really believe on general principles that if at all possible, something like this should be zero penalty.
Burcin, I obviously don't think you are trying to slow Sage down. I'm sure you know I always appreciate your efforts. It sounds like this won't actually affect flint all that much, as flint is mainly used for arithmetic with (hopefully) very low cost, and it sounds like you want to focus on higher cost algorithms at this stage. But as Martin says, getting something into Sage is the first priority. Extending it can happen later on. Obviously after Nils' post, I can see the benefit of the decorator approach. Previously I assumed that only the profiler approach could be truly zero penalty. Bill. On Monday, 8 September 2014 19:32:33 UTC+2, Nils Bruin wrote: > > On Sunday, September 7, 2014 9:24:48 AM UTC-7, Volker Braun wrote: >> >> If you want to cite inside a decision tree then you can't do that with a >> decorator. Instead of *also* having a function call syntax, we should then >> *only* have function call syntax. Nothing good ever came out of having two >> ways of achieving the same outcome. The other reason for why function call >> syntax is better is that, >> > > There is an advantage to a decorator on python-level: If you're happy to > configure sage_citation_enabled at start-up (which means it would have to > be a command line option or an environment variable), you can make it > completely *zero* penalty at runtime, with a little penalty at function > definition ("import") time: > > def cite(<citations>): > if sage_citation_enabled: > def decorator(f): > def wrapper(*args): > <register citations> > return f(*args) > return wrapper > else: > def decorator(f): return f > return decorator > > > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.