On Monday, October 27, 2014 5:03:00 AM UTC-7, Volker Braun wrote: > > On the command line we could bind == to _isomorphic_, but use _identical_ > in library code. Then we would have intuitive comparison and could still > work with associative containers. >
I don't think this would be easy to do with the current preparser. Since "==" is an infix operator, you need to fully parse the expression to substitute the called operation reliably. Our current preparser only does regex. It is of course entirely feasible to rewrite the REPL to first use python's parser to give us an AST and do substitutions on that prior to fully compiling and executing the statements. Furthermore, I think it is a strength of computer algebra systems such as sage, magma, maple that their interface language is also used for large parts of their libraries. This already doesn't quite hold true for sage, but apart from "1/2" and "2^3" it's confined to syntax that produces errors in straight python. I suspect that changing the semantics of "==" between interface and library will be much more subtle and hence more problematic (because casual testing may well not find differences). I see where your desire for "different parents means not equal" comes from (I don't think we have to go all the way to is_identical: for p-adic elements just insisting that precision also agrees should be sufficient), but I don't quite see a way to implement it that won't lead to bigger problems elsewhere. -- 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.