On Monday, October 27, 2014 10:57:58 AM UTC-7, Volker Braun wrote: > > On Monday, October 27, 2014 5:32:12 PM UTC, Nils Bruin wrote: >> >> I don't think this would be easy to do with the current preparser. >> > > As you said, we'll need to look at the AST. That is part of IPython's > preprocessing framework, trivial to implement. >
Yay! That could clean up quite a bit of preparsing. > The alternative is to not have caching and associative containers for > padics. That means you can never write Buchberger's algorithm for > polynomials with padic coefficients, say. I find that much more worrisome. > Your main example has been p-adics, which is a little different case than the "comparison between arbitrary objects and coercion". Perhaps the problem there is just that where currently we say that 1+O(5^1) == 1+ O(5^2) we should in actuality say that they are *not* equal. In fact, just as with any numerical algorithm, your first guess when you are comparing p-adics is that you're doing something wrong and should be checking, e.g., that the difference has relative precision 0, so I would expect that for most mathematical applications it doesn't matter too much what "==" means on p-adics, since anybody seriously working with them has to explicitly choose between different notions anyway, just as floats tend to not get compared for equality. Floats also don't tend to end up as keys in associative arrays. Are you sure that implementing Buchberger's algorithm would require coefficients to occur as *keys*? I would expect things to be keyed on exponent vector, but perhaps you're thinking of some optimization that works the other way around. -- 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.