Squeak 3.9: using SqNumberParser in Number>>readFrom:

Matthias Berth matthias.berth at googlemail.com
Sat Mar 24 21:21:03 UTC 2007


Thanks a lot. I don't know what went wrong with my saving to the
repository, sorry.

It looks like visitNumberDescription: will raise an error on negative numbers:

  self contents allSatisfy: [ :each | '0123456789.' includes: each ]

maybe something like this? :

  (self contents allButFirst allSatisfy: [ :each | '0123456789.'
includes: each ] )
     and:['-0123456789.' includes self contents first]

Matthias



On 3/24/07, Lukas Renggli <renggli at gmail.com> wrote:
> > I have just uploaded the fix as Magritte-Model-MatthiasBerth.250 to
> > http://mc.lukas-renggli.ch/magritte.
> >
> > I started from an older version of Magritte-Model (lr.249), and this
> > is the first time I used Monticello to write something to a
> > repository. So could someone check and maybe merge it?
>
> The package you published is empty.
>
> > I did not know where to put a unit test. In the description tests it
> > all looks so generic, and I could not find a test for MAStringReader.
>
> The tests are in the class MAElementDescription in the category
> #testing-strings. They are indeed very generic, but the tests can be
> configured in subclasses with different parameters.
>
> > How about packaging such that it is clear that one needs
> > SqNumberParser? I don't know enough about monticello, but it should be
> > possible. Is that what you mean?
>
> I would prefer a change that does not introduce external dependencies.
> One that works in 3.8 and 3.9 out of the box.
>
> I published Magritte-Model-lr.250 that should work on all Squeak
> versions. I also added a new test Magritte-Tets-lr.107 that detects
> this issue. Silently ignoring invalid input is now also fixed for
> Colors and Time.
>
> Cheers,
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
>
>



More information about the Squeak-dev mailing list