A new version of Graphics was added to project The Inbox: 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: ' )'.!
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
==================== 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: ' )'.!
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: ' )'.!
Hi Marcel, Welcome back & happy new year! :-)
IMO, it should be considered a bug that there are LayoutFrame instances with "nil" fractions.
Good point. There are many users of LayoutFrame that do not use any constructor of the class. For example, see SystemWindow closeBoxFrame. Now we could either define 2**8 constructors for all of them or, what I would find more simple, do what you proposed in [squeak-dev] The Trunk: Graphics-mt.406.mcz
[Entwurf] Diese Nachricht wurde nicht gesendet.Gespeichert am: Heute, 13:41 Uhr
we might want to change all "getters" into lazy initializers? #leftFraction, #rightFraction, ... or at least return "0" on "ifNil"?
I would prefer the second variant, just for backward compatibility.
And should we maybe initialize the offsets in #leftFraction: etc. if they are zero?
leftFraction: aNumber ^ self leftFraction: aNumber offset: self leftOffset
leftOffset ^ leftOffset ifNil: [0]
Best, Christoph
________________________________ Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel Gesendet: Montag, 6. Januar 2020 13:28:02 An: John Pfersich via Squeak-dev Betreff: Re: [squeak-dev] The Inbox: Graphics-jr.425.mcz
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
==================== 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: ' )'.!
________________________________ Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel Gesendet: Montag, 6. Januar 2020 13:32:44 An: John Pfersich via Squeak-dev Betreff: Re: [squeak-dev] The Trunk: Graphics-mt.406.mcz
Hmm... we might want to change all "getters" into lazy initializers? #leftFraction, #rightFraction, ... or at least return "0" on "ifNil"?
Best, Marcel
Am 30.12.2019 00:11:53 schrieb Jakob Reschke forums.jakob@resfarm.de:
For some reason I encounter LayoutFrames with nil in the right and bottom variables... of course, these don't understand printOn:maxDecimalPlaces:.
Am Do., 17. Jan. 2019 um 11:19 Uhr schrieb <commits@source.squeak.orgmailto:commits@source.squeak.org>: Marcel Taeumel uploaded a new version of Graphics to project The Trunk: http://source.squeak.org/trunk/Graphics-mt.406.mcz
==================== Summary ====================
Name: Graphics-mt.406 Author: mt Time: 17 January 2019, 11:18:39.003727 am UUID: 027d00a7-113d-4b9f-aaec-79e3373339c1 Ancestors: Graphics-mt.405
Adds an informative string representation for LayoutFrame to support layout design and debugging.
=============== Diff against Graphics-mt.405 ===============
Item was added: + ----- 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 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: ' )'.!
Hi all, Do we rely anywhere on having nil fractions? Otherwise, just provide #initialize and set all inst var to zero.
Le lun. 6 janv. 2020 à 14:01, Thiede, Christoph < Christoph.Thiede@student.hpi.uni-potsdam.de> a écrit :
Hi Marcel, Welcome back & happy new year! :-)
IMO, it should be considered a bug that there are LayoutFrame instances
with "nil" fractions.
Good point. There are many users of LayoutFrame that do not use any constructor of the class. For example, see SystemWindow closeBoxFrame. Now we could either define 2**8 constructors for all of them or, what I would find more simple, do what you proposed in [squeak-dev] The Trunk: Graphics-mt.406.mcz
[Entwurf] Diese Nachricht wurde nicht gesendet.Gespeichert am: Heute, 13:41 Uhr
we might want to change all "getters" into lazy initializers?
#leftFraction, #rightFraction, ... or at least return "0" on "ifNil"?
I would prefer the second variant, just for backward compatibility.
And should we maybe initialize the offsets in #leftFraction: etc. if they are zero?
leftFraction: aNumber ^ self leftFraction: aNumber offset: self leftOffset
leftOffset ^ leftOffset ifNil: [0]
Best, Christoph
*Von:* Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel *Gesendet:* Montag, 6. Januar 2020 13:28:02 *An:* John Pfersich via Squeak-dev *Betreff:* Re: [squeak-dev] The Inbox: Graphics-jr.425.mcz
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
==================== 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: ' )'.!
*Von:* Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel *Gesendet:* Montag, 6. Januar 2020 13:32:44 *An:* John Pfersich via Squeak-dev *Betreff:* Re: [squeak-dev] The Trunk: Graphics-mt.406.mcz
Hmm... we might want to change all "getters" into lazy initializers? #leftFraction, #rightFraction, ... or at least return "0" on "ifNil"?
Best, Marcel
Am 30.12.2019 00:11:53 schrieb Jakob Reschke forums.jakob@resfarm.de: For some reason I encounter LayoutFrames with nil in the right and bottom variables... of course, these don't understand printOn:maxDecimalPlaces:.
Am Do., 17. Jan. 2019 um 11:19 Uhr schrieb commits@source.squeak.org:
Marcel Taeumel uploaded a new version of Graphics to project The Trunk: http://source.squeak.org/trunk/Graphics-mt.406.mcz
==================== Summary ====================
Name: Graphics-mt.406 Author: mt Time: 17 January 2019, 11:18:39.003727 am UUID: 027d00a7-113d-4b9f-aaec-79e3373339c1 Ancestors: Graphics-mt.405
Adds an informative string representation for LayoutFrame to support layout design and debugging.
=============== Diff against Graphics-mt.405 ===============
Item was added:
- ----- 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 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: ' )'.!
Do we rely anywhere on having nil fractions?
Yes, apparently we do, have a look at #minWidthFrom:
... right := rightFraction ifNil: [1.0]. ...
Just fixed this in Graphics-ct.426.
-- Sent from: http://forum.world.st/Squeak-Dev-f45488.html
But these are unsent messages in trunk...
Le lun. 17 févr. 2020 à 15:52, Christoph Thiede < christoph.thiede@student.hpi.uni-potsdam.de> a écrit :
Do we rely anywhere on having nil fractions?
Yes, apparently we do, have a look at #minWidthFrom:
... right := rightFraction ifNil: [1.0]. ...
Just fixed this in Graphics-ct.426.
-- Sent from: http://forum.world.st/Squeak-Dev-f45488.html
Hm ... sorry, this does not yet convince me. :)
I think the best idea of a default LayoutFrame is fullscreen. This would be LayoutFrame fractions: (0 @ 0 rect: 1 @ 1) offsets: (0 @ 0 rect: 0 @ 0).
Apart from that, there is a big number of nil checks in LayoutFrame. If we introduce something like #fixup, we should also get rid of all these nil checks. Or at least, define a consistent fallback for a nil value, so either we keep the nil values as in Graphics-ct.426, or we introduce #fixUp as in Graphics-nice.425 AND change or delete #minExtentFrom: & Co.
Best,
Christoph
________________________________ Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Nicolas Cellier nicolas.cellier.aka.nice@gmail.com Gesendet: Montag, 17. Februar 2020 16:06:38 An: The general-purpose Squeak developers list Betreff: Re: [squeak-dev] The Inbox: Graphics-jr.425.mcz
But these are unsent messages in trunk...
Le lun. 17 févr. 2020 à 15:52, Christoph Thiede <christoph.thiede@student.hpi.uni-potsdam.demailto:christoph.thiede@student.hpi.uni-potsdam.de> a écrit :
Do we rely anywhere on having nil fractions?
Yes, apparently we do, have a look at #minWidthFrom:
... right := rightFraction ifNil: [1.0]. ...
Just fixed this in Graphics-ct.426.
-- Sent from: http://forum.world.st/Squeak-Dev-f45488.html
Hi Christoph, I do not agree. Most certainly, if some fraction is un-initialized, it's because we only specified the offset and want an absolute layout. Likewise, if offset are un-initialized, it's because we only specified a purely proportional layout and just want that. This makes zero the best default value (least surprising).
if someone wants a full layout default, then he just has to specify LayoutFrame full, or something like that.
Look in inbox, this goes very well. Let's eradicate those inaesthetic ifNil: [], YAGNI.
Le lun. 17 févr. 2020 à 16:55, Thiede, Christoph < Christoph.Thiede@student.hpi.uni-potsdam.de> a écrit :
Hm ... sorry, this does not yet convince me. :)
I think the best idea of a default LayoutFrame is fullscreen. This would be LayoutFrame fractions: (0 @ 0 rect: 1 @ 1) offsets: (0 @ 0 rect: 0 @ 0).
Apart from that, there is a big number of nil checks in LayoutFrame. If we introduce something like #fixup, we should also get rid of all these nil checks. Or at least, define a consistent fallback for a nil value, so either we keep the nil values as in Graphics-ct.426, or we introduce #fixUp as in Graphics-nice.425 AND change or delete #minExtentFrom: & Co.
Best,
Christoph
*Von:* Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Nicolas Cellier nicolas.cellier.aka.nice@gmail.com *Gesendet:* Montag, 17. Februar 2020 16:06:38 *An:* The general-purpose Squeak developers list *Betreff:* Re: [squeak-dev] The Inbox: Graphics-jr.425.mcz
But these are unsent messages in trunk...
Le lun. 17 févr. 2020 à 15:52, Christoph Thiede < christoph.thiede@student.hpi.uni-potsdam.de> a écrit :
Do we rely anywhere on having nil fractions?
Yes, apparently we do, have a look at #minWidthFrom:
... right := rightFraction ifNil: [1.0]. ...
Just fixed this in Graphics-ct.426.
-- Sent from: http://forum.world.st/Squeak-Dev-f45488.html
+1
/————————————————————/ For encrypted mail use jgpfersich@protonmail.com Get a free account at ProtonMail.com Web: https://objectnets.net and https://objectnets.org https://datascilv.com https://datascilv.org
On Feb 17, 2020, at 08:15, Nicolas Cellier nicolas.cellier.aka.nice@gmail.com wrote:
Hi Christoph, I do not agree. Most certainly, if some fraction is un-initialized, it's because we only specified the offset and want an absolute layout. Likewise, if offset are un-initialized, it's because we only specified a purely proportional layout and just want that. This makes zero the best default value (least surprising).
if someone wants a full layout default, then he just has to specify LayoutFrame full, or something like that.
Look in inbox, this goes very well. Let's eradicate those inaesthetic ifNil: [], YAGNI
squeak-dev@lists.squeakfoundation.org