Aug. 15, 2009
9:04 a.m.
Taking a hint from the comments (yes, I do listen), here is a "less complex" :) solution: Complex>> < aNumber "Not defined on Complex numbers" ^self asReal < aNumber asReal Complex>> asReal "Answer real-part of self if imaginary is zero else, error" (imaginary = 0) ifTrue: [^real] ifFalse: [self error: 'Can''t convert to real'] Better? -KenD