Begin forwarded message:
From: nicolas cellier <ncellier@ifrance.com> Date: August 20, 2008 2:56:22 PM CEDT To: stephane ducasse <stephane.ducasse@free.fr> Subject: Re: besoin d'un peu d'aide
stephane ducasse a écrit :
bonjour nicolas
dans pharo on a un probleme avec un le print de largepositiveInteger. Si tu pouvais jeter un oeil cela nous aiderait. http://code.google.com/p/pharo/wiki/Downloads?tm=2 + update
- LargePositiveInteger new: 4 + printString => boum
merci par avance.
Stef
Salut Stef, La version Integer-fastPrint-M6887-nice.8.cs ( http://bugs.squeak.org/file_download.php?file_id=3430&type=bug ) corrige ce cas avec les deux lignes suivantes au début de LargePositiveInteger>>#printOn:base:
"Don't engage any arithmetic if not normalized" (self digitLength = 0 or: [(self digitAt: self digitLength) = 0]) ifTrue: [^self normalize printOn: aStream base: b].
Le script d'installation a été mis à jour le 21 juillet à http://bugs.squeak.org/view.php?id=6887
J'ai aussi proposé une version .9.cs qui remplace le test par plus explicite:
"Don't engage any arithmetic if not normalized" self isNormalized ifFalse: [^self normalize printOn: aStream base: b].
Mais ma version de #isNormalized bien que suffisante pour cette utilisation, n'est pas complète: elle ne teste pas si le nombre peut être réduit en SmallInteger... Il faudrait la compléter, ce qui a peu d'intérêt tant qu'il y a un seul sender. Je recommande donc plutôt la version .8.cs A toi de voir.
Bon courage pour la suite