[squeak-dev] LayoutFrame>>#printOn:

Jakob Reschke forums.jakob at resfarm.de
Wed Sep 18 16:38:37 UTC 2019


If you do that please don't name it "store it". It would be totally
non-obvious what such an action would do.

Moreover, as others already pointed out in the other thread, most objects
don't support producing evaluable expressions well.

Compromise: can we introduce additional factory methods to make the
LayoutFrame string both easy to grasp and evaluable? So it would satisfy
both Marcel and Christoph?

Marcel Taeumel <marcel.taeumel at hpi.de> schrieb am Mi., 18. Sep. 2019, 17:20:

> > Is LayoutFrame fractions: (0.25 at 0 corner: 0.5 at 0.42) offsets: (4 at 0
> corner: 0@ -20) actually harder to read than a LayoutFrame( l 0.25+4 t
> 0+0 r 0.5+0 b 0.42-20 ) ?
>
>
> Yes, because it separates left fraction + left offset (etc.) visually.
> Again, the current printOn: reflects my personal debugging needs. :-) No,
> #printOn: does not have to be evaluable. We use #storeOn: for that. Until
> recently, #printOn: wasn't even implemented in LayoutFrame. Feel free to
> improve it for reasons other than evaluability. ;-)
>
>
> Do you want to have a "print it" shortcut for #storeString? Like "store
> it"? Like CMD+SHIFT+P instead of CMD+P? That might be a nice productivity
> tool...
>
>
> Best,
>
> Marcel
>
> Am 18.09.2019 16:15:19 schrieb Thiede, Christoph <
> christoph.thiede at student.hpi.uni-potsdam.de>:
>
> Hi Marcel,
>
>
> actually I find re-evaluability quite often useful - for example, when I
> would like to take the LayoutFrame and set it to another Morph. At the
> moment you need to totally deconstruct + rewrite the expression to reuse
> it, while on the other hand you can directly print-and-eval points and
> rectangles. For beginners, it also helps to understand how the Objects are
> created.
>
>
> Is
>
> LayoutFrame fractions: (0.25 at 0 corner: 0.5 at 0.42) offsets: (4 at 0 corner: 0@
> -20)
>
> actually harder to read than
>
> a LayoutFrame( l 0.25+4 t 0+0 r 0.5+0 b 0.42-20 )
>
> ?
>
> (Imho, the latter with the unfamiliar non-Smalltalk syntax looks much more
> confusing to me. :) )
>
>
> Best,
>
> Christoph
> ------------------------------
> *Von:* Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im
> Auftrag von Taeumel, Marcel
> *Gesendet:* Mittwoch, 18. September 2019 13:54:55
> *An:* Alan Grimes via Squeak-dev
> *Betreff:* Re: [squeak-dev] LayoutFrame>>#printOn:
>
> Hi Christoph,
>
> I recently changed that to be more valuable for me when debugging layout
> issues. Feel free to add more "ifNil" checks if needed - there are already
> some.
>
> However, there is no need to make that string re-evaluable. It's designed
> to fit the human eye. At least mine. :-)
>
>
> Best,
> Marcel
>
> Am 18.09.2019 13:50:09 schrieb Thiede, Christoph <
> christoph.thiede at student.hpi.uni-potsdam.de>:
>
> Hi all,
>
>
> is anyone attached to the current LayoutFrame>>#printOn: design?
>
> The current one fails if some instvars are nil. This is the case for
> SystemWindowButtons.
>
> Furthermore, I never liked the current string representation, it has
> a quite cryptic look and does not match the common way you create a
> LayoutFrame using #fractions:/#offsets:.
>
>
> Would anyone mind me to rewrite #printOn: in order to return a
> re-evaluatable string? Are there any dependencies?
>
>
> Best,
>
> Christoph
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190918/b74d2ddf/attachment-0001.html>


More information about the Squeak-dev mailing list