[squeak-dev] The Inbox: System-cmm.497.mcz
Chris Muller
ma.chris.m at gmail.com
Sat Jun 29 21:24:20 UTC 2013
Did you review the discussion from back then? The problem with this
proposal was it doesn't go far enough. IIRC, by not having a clear
picture how we would support multiple Author's, the change ends up
being little more than an API change for accessing the global author;
a "place to put some methods"; rather than integrating a first-class
Author into the system object model.
If we are going to rob the global namespace of such a prominent class
name like "Author" from all external domains (or else force them to
use Environments?), then we cannot half-ass it. We are not going to
trade "Author" for just a global-slot holder. It needs to become an
integral part of the system's object model.
On Sat, Jun 29, 2013 at 3:58 PM, Frank Shearar <frank.shearar at gmail.com> wrote:
> I would love to see this resuscitated!
>
> frank
>
> On 15 September 2012 17:33, Chris Muller <asqueaker at gmail.com> wrote:
>> Ok.
>>
>> On Fri, Sep 14, 2012 at 11:06 PM, Levente Uzonyi <leves at elte.hu> wrote:
>>> Two things about the implementation:
>>> - using #isOctetCharacter is not good enough. When I wrote ascii, I meant
>>> the 7-bit US-ASCII characters. For example $á is both #isOctetCharacter and
>>> #isAlphaNumeric, but I don't think it should appear in a method's timestamp.
>>> - some methods have Smalltalk123 as author
>>>
>>>
>>> Levente
>>>
>>>
>>> On Fri, 14 Sep 2012, commits at source.squeak.org wrote:
>>>
>>>> A new version of System was added to project The Inbox:
>>>> http://source.squeak.org/inbox/System-cmm.497.mcz
>>>>
>>>> ==================== Summary ====================
>>>>
>>>> Name: System-cmm.497
>>>> Author: cmm
>>>> Time: 14 September 2012, 3:14:45.552 pm
>>>> UUID: d55d42e9-1782-4cdd-a0d0-253bf60940f5
>>>> Ancestors: System-ul.496
>>>>
>>>> Updates for the Author proposal:
>>>>
>>>> - Completely separate the model from the UI. Author should be a
>>>> "pure domain object." The PerSe methods are no longer needed.
>>>>
>>>> - Instead, let Utilities class take responsibility for employing
>>>> Squeak UI-elements to set the current Author attributes, as well as for
>>>> being the "convenient" way to access these attributes.
>>>>
>>>> - Since we are reifying an Author from a String, it is now treated
>>>> as a whole Author object, rather than just a String-holder. Allow multiple
>>>> Author instances to exist and the #current Author can be swapped out with
>>>> another Author instance.
>>>>
>>>> =============== Diff against System-ul.496 ===============
>>>>
>>>> Item was removed:
>>>> - ----- Method: Author class>>changeStamp (in category 'convenience')
>>>> -----
>>>> - changeStamp
>>>> -
>>>> - ^self current changeStamp!
>>>>
>>>> Item was removed:
>>>> - ----- Method: Author class>>changeStampPerSe (in category 'convenience')
>>>> -----
>>>> - changeStampPerSe
>>>> -
>>>> - ^self current changeStampPerSe!
>>>>
>>>> Item was changed:
>>>> ----- Method: Author class>>current (in category 'instance creation')
>>>> -----
>>>> current
>>>> + ^ instance ifNil:
>>>> + [ self current: self new.
>>>> + instance ]!
>>>> -
>>>> - ^instance ifNil: [ instance := super new ]!
>>>>
>>>> Item was added:
>>>> + ----- Method: Author class>>current: (in category 'class
>>>> initialization') -----
>>>> + current: anAuthor
>>>> + instance := anAuthor!
>>>>
>>>> Item was changed:
>>>> ----- Method: Author class>>fullNamePerSe (in category 'pharo
>>>> compatibility') -----
>>>> fullNamePerSe
>>>> + ^ self current initials!
>>>> -
>>>> - ^self initialsPerSe!
>>>>
>>>> Item was removed:
>>>> - ----- Method: Author class>>initials (in category 'convenience') -----
>>>> - initials
>>>> -
>>>> - ^self current initials!
>>>>
>>>> Item was removed:
>>>> - ----- Method: Author class>>initialsPerSe (in category 'convenience')
>>>> -----
>>>> - initialsPerSe
>>>> -
>>>> - ^self current initialsPerSe!
>>>>
>>>> Item was removed:
>>>> - ----- Method: Author class>>new (in category 'instance creation') -----
>>>> - new
>>>> -
>>>> - self error: 'Use #current'!
>>>>
>>>> Item was changed:
>>>> ----- Method: Author class>>reset (in category 'instance creation') -----
>>>> reset
>>>> + self current: nil!
>>>> -
>>>> - instance := nil!
>>>>
>>>> Item was changed:
>>>> ----- Method: Author class>>useAuthor:during: (in category 'pharo
>>>> compatibility') -----
>>>> + useAuthor: aString during: aBlock
>>>> + ^ self current
>>>> + useInitials: aString
>>>> + during: aBlock!
>>>> - useAuthor: aString during: aBlock
>>>> -
>>>> - ^self useInitials: aString during: aBlock!
>>>>
>>>> Item was removed:
>>>> - ----- Method: Author class>>useInitials:during: (in category
>>>> 'convenience') -----
>>>> - useInitials: aString during: aBlock
>>>> -
>>>> - ^self current useInitials: aString during: aBlock!
>>>>
>>>> Item was removed:
>>>> - ----- Method: Author class>>username (in category 'convenience') -----
>>>> - username
>>>> -
>>>> - ^self current username!
>>>>
>>>> Item was removed:
>>>> - ----- Method: Author class>>usernamePerSe (in category 'convenience')
>>>> -----
>>>> - usernamePerSe
>>>> -
>>>> - ^self current usernamePerSe!
>>>>
>>>> Item was changed:
>>>> ----- Method: Author>>changeStamp (in category 'accessing') -----
>>>> changeStamp
>>>> + ^ self changeStampWithInitials: (self initials ifEmpty: [
>>>> 'unknown' ])!
>>>> -
>>>> - ^self changeStampWithInitials: self initials!
>>>>
>>>> Item was removed:
>>>> - ----- Method: Author>>changeStampPerSe (in category 'accessing') -----
>>>> - changeStampPerSe
>>>> -
>>>> - ^self changeStampWithInitials: (self initialsPerSe ifEmpty: [ '.'
>>>> ])!
>>>>
>>>> Item was changed:
>>>> ----- Method: Author>>fullName (in category 'pharo compatibility') -----
>>>> fullName
>>>> + ^ self initials!
>>>> -
>>>> - ^self initials!
>>>>
>>>> Item was removed:
>>>> - ----- Method: Author>>fullNamePerSe (in category 'pharo compatibility')
>>>> -----
>>>> - fullNamePerSe
>>>> -
>>>> - ^self initialsPerSe!
>>>>
>>>> Item was changed:
>>>> ----- Method: Author>>initialize (in category 'initialize-release') -----
>>>> initialize
>>>> -
>>>> super initialize.
>>>> + initials := username := String empty!
>>>> - initials := String new.
>>>> - username := String new
>>>> - !
>>>>
>>>> Item was changed:
>>>> ----- Method: Author>>initials (in category 'accessing') -----
>>>> initials
>>>> + ^ initials!
>>>> -
>>>> - ^initials ifEmpty: [ self requestAndSetInitials ]!
>>>>
>>>> Item was removed:
>>>> - ----- Method: Author>>initialsPerSe (in category 'accessing') -----
>>>> - initialsPerSe
>>>> -
>>>> - ^initials!
>>>>
>>>> Item was removed:
>>>> - ----- Method: Author>>requestAndSetInitials (in category 'accessing')
>>>> -----
>>>> - requestAndSetInitials
>>>> -
>>>> - ^initials := (UIManager default
>>>> - request: 'Please type your initials: ' translated
>>>> - initialAnswer: initials) select: [ :each |
>>>> - #(
>>>> - ($A $Z)
>>>> - ($a $z)
>>>> - ($0 $9)) anySatisfy: [ :range |
>>>> - each between: range first and:
>>>> range second ] ]!
>>>>
>>>> Item was removed:
>>>> - ----- Method: Author>>requestAndSetUsername (in category 'accessing')
>>>> -----
>>>> - requestAndSetUsername
>>>> -
>>>> - ^username := UIManager default
>>>> - request: 'Please type your name:' translated
>>>> - initialAnswer: (username
>>>> - ifEmpty: [ 'Your Name' translated ]
>>>> - ifNotEmpty: [ username ])!
>>>>
>>>> Item was changed:
>>>> ----- Method: Author>>username (in category 'accessing') -----
>>>> username
>>>> + ^ username!
>>>> -
>>>> - ^username ifEmpty: [ self requestAndSetUsername ]!
>>>>
>>>> Item was removed:
>>>> - ----- Method: Author>>usernamePerSe (in category 'accessing') -----
>>>> - usernamePerSe
>>>> -
>>>> - ^username!
>>>>
>>>> Item was changed:
>>>> ----- Method: SpaceTally>>spaceTally: (in category 'class analysis')
>>>> -----
>>>> + spaceTally: classes
>>>> - spaceTally: classes
>>>> "Answer a collection of SpaceTallyItems representing the memory
>>>> space (in bytes) consumed by the code and instances of each class in
>>>> the system. Note that code sizes do not currently report memory consumed
>>>> by class variables. "
>>>> -
>>>> "((SpaceTally new spaceTally: (Array with: TextMorph with: Point))
>>>> asSortedCollection: [:a :b | a spaceForInstances > b spaceForInstances])
>>>> asArray"
>>>> -
>>>> self preAllocateResultsFor: classes.
>>>> Smalltalk garbageCollect.
>>>> self computeSpaceUsage.
>>>> ^ results
>>>> + sort: [ : a : b | a spaceForInstances > b
>>>> spaceForInstances ] ;
>>>> + yourself!
>>>> - !
>>>>
>>>> Item was changed:
>>>> ----- Method: Utilities class>>authorInitials (in category
>>>> 'identification') -----
>>>> authorInitials
>>>> + "Answer the initials to be used to identify the current code
>>>> author."
>>>> + ^ self authorInitialsPerSe ifEmpty:
>>>> + [ self
>>>> + setAuthorInitials ;
>>>> + authorInitialsPerSe ]!
>>>> - "Answer the initials to be used to identify the current code
>>>> author. "
>>>> -
>>>> - ^Author initials!
>>>>
>>>> Item was changed:
>>>> ----- Method: Utilities class>>authorInitialsPerSe (in category
>>>> 'identification') -----
>>>> authorInitialsPerSe
>>>> + ^ Author current initials!
>>>> - "Answer the currently-prevailing author initials, such as they,
>>>> empty or not"
>>>> -
>>>> - ^Author initialsPerSe!
>>>>
>>>> Item was changed:
>>>> ----- Method: Utilities class>>authorName (in category 'identification')
>>>> -----
>>>> authorName
>>>> + ^ self authorNamePerSe ifEmpty:
>>>> + [ self
>>>> + setAuthorName ;
>>>> + authorNamePerSe ]!
>>>> -
>>>> - ^Author username!
>>>>
>>>> Item was changed:
>>>> ----- Method: Utilities class>>authorNamePerSe (in category
>>>> 'identification') -----
>>>> authorNamePerSe
>>>> + ^ Author current username!
>>>> -
>>>> - ^Author usernamePerSe!
>>>>
>>>> Item was changed:
>>>> ----- Method: Utilities class>>changeStamp (in category 'identification')
>>>> -----
>>>> + changeStamp
>>>> + ^ Author current changeStampWithInitials: self authorInitials!
>>>> - changeStamp
>>>> -
>>>> - ^Author changeStamp!
>>>>
>>>> Item was changed:
>>>> ----- Method: Utilities class>>changeStampPerSe (in category
>>>> 'identification') -----
>>>> changeStampPerSe
>>>> + ^ Author current changeStamp!
>>>> -
>>>> - ^Author changeStampPerSe!
>>>>
>>>> Item was changed:
>>>> ----- Method: Utilities class>>setAuthorInitials (in category
>>>> 'identification') -----
>>>> setAuthorInitials
>>>> "Put up a dialog allowing the user to specify the author's
>>>> initials. "
>>>> + | oldInitials |
>>>> + oldInitials := Author current initials.
>>>> + Author reset.
>>>> + Author current initials:
>>>> + ((UIManager default
>>>> + request: 'Please type your initials: ' translated
>>>> + initialAnswer: oldInitials) select: [ : each |
>>>> each isOctetCharacter and: [ each isAlphaNumeric ] ])!
>>>> -
>>>> - ^Author current requestAndSetInitials!
>>>>
>>>> Item was changed:
>>>> ----- Method: Utilities class>>setAuthorName (in category
>>>> 'identification') -----
>>>> setAuthorName
>>>> + Author current username:
>>>> + (UIManager default
>>>> + request: 'Please type your name:' translated
>>>> + initialAnswer: (Author current username ifEmpty: [
>>>> 'Your Name' translated ]))!
>>>> -
>>>> - Author requestAndSetUsername!
>>>>
>>>>
>>>
>>>
>>>
>>
More information about the Squeak-dev
mailing list
|