[squeak-dev] The Trunk: Collections-dtl.548.mcz

Frank Shearar frank.shearar at gmail.com
Fri Dec 13 16:06:25 UTC 2013


On 13 December 2013 15:57, Chris Muller <asqueaker at gmail.com> wrote:
> On Fri, Dec 13, 2013 at 7:08 AM, Frank Shearar <frank.shearar at gmail.com>
> wrote:
>>
>> On 13 December 2013 12:57, David T. Lewis <lewis at mail.msen.com> wrote:
>> > On Fri, Dec 13, 2013 at 07:42:28AM +0000, Frank Shearar wrote:
>> >> On 12 December 2013 23:58,  <commits at source.squeak.org> wrote:
>> >> > David T. Lewis uploaded a new version of Collections to project The
>> >> > Trunk:
>> >> > http://source.squeak.org/trunk/Collections-dtl.548.mcz
>> >> >
>> >> > ==================== Summary ====================
>> >> >
>> >> > Name: Collections-dtl.548
>> >> > Author: dtl
>> >> > Time: 12 December 2013, 6:58:08.878 pm
>> >> > UUID: b167353b-b9ab-4911-8168-c5f184cab62a
>> >> > Ancestors: Collections-ul.547
>> >> >
>> >> > Transcripter>>initInFrame: should do nothing when not in MVC
>> >> >
>> >> > =============== Diff against Collections-ul.547 ===============
>> >> >
>> >> > Item was changed:
>> >> >   ----- Method: Transcripter>>initInFrame: (in category
>> >> > 'initialization') -----
>> >> >   initInFrame: rect
>> >> > +       Smalltalk at: #Paragraph ifPresent: [:classParagraph | "MVC"
>> >> > +               frame := rect insetBy: 2.  "Leave room for border"
>> >> > +               para := classParagraph withText: self contents asText
>> >> > +                                       style: TextStyle default
>> >> > +                                       compositionRectangle: ((frame
>> >> > insetBy: 4) withHeight: 9999)
>> >> > +                                       clippingRectangle: frame
>> >> > +                                       foreColor: self black
>> >> > backColor: self white]!
>> >> > -       frame := rect insetBy: 2.  "Leave room for border"
>> >> > -       (Smalltalk hasClassNamed: #Paragraph)
>> >> > -               ifFalse: [^ self inform: 'MVC class Paragraph not
>> >> > present'].
>> >> > -       para := (Smalltalk at: #Paragraph) withText: self contents
>> >> > asText
>> >> > -                               style: TextStyle default
>> >> > -                               compositionRectangle: ((frame
>> >> > insetBy: 4) withHeight: 9999)
>> >> > -                               clippingRectangle: frame
>> >> > -                               foreColor: self black backColor: self
>> >> > white!
>
>
> Dave, the only thing I don't like about this change is I thought we said we
> were going to migrate away from using the Dictionary API on Smalltalk.  This
> was back when Andreas and community came up with the idea of the wrapped
> 'globals'.
>
> I think it would be better to use
>
>     (Smalltalk classNamed: #Paragraph) ifNotNil: [ : classParagraph | ... ]
>
> otherwise we can never find all the places where we try to do logical access
> to class.

In which case we should have #bindingOf:ifPresent, or similar. An API
that forces you to acknowledge the potential not-there-ness of a thing
is far preferable, in my book, to a separate-check-then-use. The
latter also have fun time-of-check-time-of-use issues in a
multiprocessing environment... which we happen to have.

>> >> Well, that definitely stops a DNU and such when running in Morphic
>> >> (yay!) but it still won't work in a non-MVC/Morphic world. That's when
>> >> you accused me of overengineering, David :)
>> >
>> > Yes you're right, I meant that with a smiley, sorry :)
>>
>> I knew there was something of a smiley in there :) I just meant that
>> if we want to preserve the Transcripter's emergencyEvaluator we would
>> need this "complexity" because we'd need an emergencyEvaluator per UI
>> framework.
>
>
> -1.  Please be more conservative and lazy about putting new code/elements
> into the system.  TSTTCPW demands that we don't start building out
> infrastructure for new UI frameworks until those frameworks are being pushed
> into existence and such a factoring is actually NEEDED.  Please only write
> code for the "now" not for some "potential future".  10 years could go by
> with no new graphical frameworks and then someone looking at your
> class-hierarchy will regard it as "cruft".

(a) The emergency evaluator's there _for good reason_.
(b) We HAVE two UI frameworks right now. They're part of the standard image.
(c) "Stripped" 4.5 base images do not have ST80, so this code is broken.
(d) To fix it _requires_ two separate UI implementations because of point (b).

Unless you're specifically saying "we should not have an emergency
evaluator". But then say that, not -1 me suggesting a way to fix
something broken. (Please feel free to suggest a simpler way of
solving the problem that works for all CURRENT UI frameworks.)

frank


More information about the Squeak-dev mailing list