Igor Stasenko a écrit :
2008/8/31 Stéphane Rollandin lecteur@zogotounga.net:
nicolas cellier a écrit :
Strangely, Squeak Number class>>#readfrom: used to accept non Smalltalk syntax like: (Number readFrom: '.2') -> 0.2 . (Number readFrom: '2.e3') -> 2000.0 . Now I see that Dave Lewis (dtl) asserted this feature: I'd like to remove this feature. Is it ok?
I would vote for allowing those formats.
My guess it can stay, but only as separate helper method, which reads a numbers and expecting non-smalltalk syntax. And making sure that this behavior is completely separated from compiler!
Agree, that's a requirement, ambiguous syntax must be avoided, and compatibility with other ST dialects not altered too much.
Then nothing prevents having two utility messages and/or two NumberParser subclasses (or more). As long as kernel code doing the conversion decimal->binary is not duplicated (It's already hard enough to get it doing things exactly, better not maintain two versions).
The question remains if the extended syntax should be part of the kernel, or not, and if yes, what syntax exactly?
My feeling is that such extension should be a package.
Stef