What is the advantage of nil fractions compared to zero fractions?
No advantages, I think. Just additional ifNil-checks somewhere else. IMO, it should be considered a bug that there are LayoutFrame instances with "nil" fractions.
Best, Marcel Am 30.12.2019 14:15:28 schrieb Thiede, Christoph christoph.thiede@student.hpi.uni-potsdam.de: Ah yes, we had also talked about this in [squeak-dev] LayoutFrame>>#printOn: [http://forum.world.st/LayoutFrame-printOn-tp5104021.html].
Maybe we should define whether fractions are okay to be nil here. What is the advantage of nil fractions compared to zero fractions? Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von commits@source.squeak.org commits@source.squeak.org Gesendet: Montag, 30. Dezember 2019 03:11:52 An: squeak-dev@lists.squeakfoundation.org Betreff: [squeak-dev] The Inbox: Graphics-jr.425.mcz A new version of Graphics was added to project The Inbox: http://source.squeak.org/inbox/Graphics-jr.425.mcz [http://source.squeak.org/inbox/Graphics-jr.425.mcz]
==================== Summary ====================
Name: Graphics-jr.425 Author: jr Time: 30 December 2019, 3:11:45.845402 am UUID: 465fa95d-6a50-a84d-8b73-7e90a2b9d2b5 Ancestors: Graphics-pre.424
Fix message not understood when the right or bottom fraction of a LayoutFrame is nil.
=============== Diff against Graphics-pre.424 ===============
Item was changed: ----- Method: LayoutFrame>>printOn: (in category 'printing') ----- printOn: aStream super printOn: aStream. aStream nextPutAll: '( '. { {'l'. self leftFraction. self leftOffset}. {'t'. self topFraction. self topOffset}. {'r'. self rightFraction. self rightOffset}. {'b'. self bottomFraction. self bottomOffset} } do: [:spec | aStream nextPutAll: spec first; space. + (spec second ifNil: [0]) printOn: aStream maxDecimalPlaces: 2. - spec second printOn: aStream maxDecimalPlaces: 2. aStream nextPutAll: ((spec third ifNil: [0]) >= 0 ifTrue: ['+'] ifFalse: ['-']). (spec third ifNil: [0]) abs printOn: aStream maxDecimalPlaces: 0] separatedBy: [aStream space]. aStream nextPutAll: ' )'.!