2009/8/15 <csrabak@bol.com.br>:
It helps to undestand your suggestion.
It does not help to make it Smalltalk friendly, my meaning of that being the "principle of least surprise".
least suprise for who? For you it could be the least surprise. For me, and for other people it would be a big surprise. So, please give a better/different reasoning, why in a presence of Complex numbers, a functions which operating with Real numbers should change their behavior. Integers are subset of Real set and Real is a subset of Complex, then one could happily write: Array new: 0.2i and following your reasoning, the above is good way to write a code and it should work well.
If complex math is to be allowed a natural consequence is that a lot of functions would return complex answers for real arguments.
How would then have Pharo Smalltalk behave in a case of computing a reactance: X = jÏL?
anInductance being Number and complexFrequency obviously being Complex:
aReactance := anInductance * complexFrequency
Em 15/08/2009 13:55, Schwab,Wilhelm K < bschwab@anest.ufl.edu > escreveu:
Nothing tricky: just that methods answering complex results should be defined only by things tha are already complex. -1 sqrt blows up; -1 asComplex answers i. There would be no imlicit conversion between real and complex, allowing the base system to perform as it does now and still allowing all the complex number crunching anyone wants to do. Does that help? Bill
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.