Hi Vincent, On 2016-11-15, Vincent Delecroix <20100.delecr...@gmail.com> wrote: >>> Perhaps was the proposal too greedy, so i wonder whether there would be a >>> possibility to have a trool adding an Unknown to bool that does not >>> perturb the speed when only True and False are used, and so that the >>> "short-circuiting semantics" remains preserved. >> >> No way! In an expression such as >> >> "True or whatever_function(x)" >> >> the "whatever_function(x)" is *not* evaluated... >> >> sage: def f(): print "hello" >> sage: True or f() >> True > > Though it would be doable with signatures of functions. > > def bool whatever_function() > > would avoid evaluation but > > def trool whatever_function() > > would do it. However, it is a drastic change that needs some kind of > signature for functions.
Where is the problem? Obviously "True or Unknown" is True. Hence, in "True or whatever_function(x)", it is not needed to evaluate the function. Evaluation is only required in "False or whatever_function(x)" (as it is now) and "Unknown or whatever_function(x)". Cheers, Simon -- 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 https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.