Many thanks Nils for your help. I think that is important that sage has consistent and easy to use interfaces, that functions do what most people would expect them to do at every place. Specially if we want it to be used in calculus classes, etc.
Writing something like SR(0).function(x) instead of ConstantFunction(0) is not what most mathematicians or students would do, I guess. Maybe there is something to improve here. Pablo On Mon, Feb 16, 2015 at 1:39 PM, Nils Bruin <[email protected]> wrote: > On Monday, February 16, 2015 at 8:33:49 AM UTC-8, Nils Bruin wrote: >> >> >> f3=Piecewise([([0,1],SR(0).function(x)),([1,2],(1-x).function(x))]) > > > Incidentally, the Piecewise documentation, which you can get with > "Piecewise?" , has a nice shortcut form: > > sage: f3 = Piecewise([([0,1],SR(0)), ([1,2],1-x)], x) > > (unfortunately it is necessary to write "SR(0)" there) > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sage-devel. > For more options, visit https://groups.google.com/d/optout. -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
