From: Colin P. A. <co...@co...> - 2007-02-03 14:56:43
|
>>>>> "Eric" == Eric Bezault <er...@go...> writes: Eric> I had a look at the routines `is_integer_64' and Eric> `to_integer_64' in class KL_STRING_ROUTINES. And there are Eric> two things that I don't like. The first thing is that they Eric> create too many temporary objects (calling `substring', Eric> creating manifest arrays). Yes. I wasn't happy with that myself. Eric> The second thing that I don't Eric> like is the precondition "is_integer". I don't think that it Eric> is a good idea to have to write: Eric> is_integer (s) and then is_integer_64 (s) Well I thought about that. And I thought about the use case I have, which is parsing numbers. The tokenizer has already created tokens one of which is certified to consist entirely of decimal digits (there may be a preceding token consisting of a minus sign). In this use case the pre-condition "is_integer" is guarenteed true. So I tried to think about other use cases for "is_integer_64". All I could think of was parsing, and I presumed therefore that the pre-condition would always be satisfied. -- Colin Adams Preston Lancashire |