[squeak-dev] The Trunk: Morphic-fbs.677.mcz

Levente Uzonyi leves at elte.hu
Sun Aug 11 19:50:28 UTC 2013


On Sun, 11 Aug 2013, Frank Shearar wrote:

> On 10 August 2013 23:46, Levente Uzonyi <leves at elte.hu> wrote:
>> On Sat, 10 Aug 2013, commits at source.squeak.org wrote:
>>
>>> Frank Shearar uploaded a new version of Morphic to project The Trunk:
>>> http://source.squeak.org/trunk/Morphic-fbs.677.mcz
>>>
>>> Item was added:
>>> + ----- Method: CurvierMorph class>>Curvier (in category 'class
>>> initialization') -----
>>> + Curvier
>>> +       <preference: 'Curvier'
>>> +               category: 'morphic'
>>> +               description: 'If true, closed CurvierMorphs will be
>>> smoother and more symmetrical all about. If false they will mimic the old
>>> curve shapes with the one sharp bend.'
>>> +               type: #Boolean>
>>> +       ^ self drawCurvier.!
>>>
>>> Item was added:
>>> + ----- Method: CurvierMorph class>>drawCurvier (in category 'class
>>> initialization') -----
>>> + drawCurvier
>>> +       ^ DrawCurvier.!
>>
>>
>> I think the above two methods should be replaced with this:
>>
>> drawCurvier
>>
>>         <preference: 'Curvier'
>>                 category: 'morphic'
>>
>>                 description: 'If true, closed CurvierMorphs will be smoother
>> and more symmetrical all about. If false they will mimic the old curve
>> shapes with the one sharp bend.'
>>                 type: #Boolean>
>>         ^DrawCurvier ifNil: [ true ]
>>
>> Why?
>> - The setter method's name is derived from the getter method's name via
>> #asMutator. The getter method is always the method which holds the pragma.
>> So this code doesn't work.
>> - It's better to have a default value, than to get a debugger when the
>> variable is uninitialized.
>> - Capitalized selector names are unusual in smalltalk code, when no external
>> code/data/objects are involved.
>
> I'd largely agree, but I intentionally performed a _refactoring_ here,
> preserving the API. We should do what you suggest, and keep Curvier
> but deprecated and in 45Deprecated for eventual GC.

I don't see why should we keep a recently introduced method with no 
senders, and an awkward name.


Levente

>
> frank
>
>> Levente
>>
>>
>>>
>>> Item was added:
>>> + ----- Method: CurvierMorph class>>drawCurvier: (in category 'class
>>> initialization') -----
>>> + drawCurvier: aBoolean
>>> +       DrawCurvier := aBoolean.!
>>>
>>> Item was changed:
>>>  ----- Method: PolygonMorph>>isCurvier (in category 'testing') -----
>>>  isCurvier
>>>         "Test used by smoothing routines.  If true use true closed curve
>>> splines for closed curves. If not mimic old stodgy curveMorph curves with
>>> one sharp bend.. Override this routine in classes where backward
>>> compatability is still needed."
>>> +       ^ CurvierMorph drawCurvier!
>>> -       ^ (Preferences valueOfFlag: #Curvier)!
>>>
>>>
>>>
>>
>
>


More information about the Squeak-dev mailing list