[squeak-dev] The Inbox: PackageInfo-Base-bf.65.mcz

Bert Freudenberg bert at freudenbergs.de
Sat Jul 28 23:15:30 UTC 2012


On 28.07.2012, at 16:02, Chris Muller wrote:

> -1 on the dramatic 'THIS PACKAGE HAS NO COMMENT'.  nil is the standard
> and sufficient way to indicate the package has no comment.

The default comment is never stored in the package. It's just used in the interface if there is no comment.

My idea was to mimic how a missing class comment was displayed, but now I see that instead, the system browser shows a template for the class comment. I misremembered.

So a better default might be "Description of this package"?

> As far as even having a comment variable -- could you explain how
> PackageInfo is intended to be used -- e.g., what code would be calling
> the comment: setter?

No code currently uses that setter. MC deals with the StringHolder directly.

This is exactly the same as the preamble/unload scripts.

- Bert -

> 
> On Sat, Jul 28, 2012 at 4:31 PM,  <commits at source.squeak.org> wrote:
>> Bert Freudenberg uploaded a new version of PackageInfo-Base to project The Inbox:
>> http://source.squeak.org/inbox/PackageInfo-Base-bf.65.mcz
>> 
>> ==================== Summary ====================
>> 
>> Name: PackageInfo-Base-bf.65
>> Author: bf
>> Time: 28 July 2012, 2:20:30.545 pm
>> UUID: 52c0359f-bd7e-4f1f-9a33-95b5cef7abb4
>> Ancestors: PackageInfo-Base-bf.64
>> 
>> Add per-package comments.
>> 
>> =============== Diff against PackageInfo-Base-bf.64 ===============
>> 
>> Item was changed:
>>  Object subclass: #PackageInfo
>> +       instanceVariableNames: 'packageName methodCategoryPrefix preamble postscript preambleOfRemoval postscriptOfRemoval comment'
>> -       instanceVariableNames: 'packageName methodCategoryPrefix preamble postscript preambleOfRemoval postscriptOfRemoval'
>>        classVariableNames: ''
>>        poolDictionaries: ''
>>        category: 'PackageInfo-Base'!
>>  PackageInfo class
>>        instanceVariableNames: 'default'!
>> 
>>  !PackageInfo commentStamp: 'bf 7/28/2012 14:11' prior: 0!
>>  PackageInfo is used by the system to figure out which classes and methods belong to which package. By default, class categories and method categories are matched against my packageName, but subclasses could override this behavior.
>> 
>>  For an interesting use of PackageInfo subclasses have a look at OMeta2. It presents the same code base as two different packages, one using decompiled code for bootstrapping, the other using the actual OMeta syntax.!
>>  PackageInfo class
>>        instanceVariableNames: 'default'!
>> 
>> Item was added:
>> + ----- Method: PackageInfo>>comment (in category 'preamble/postscript') -----
>> + comment
>> +       ^ comment ifNil: [
>> +               comment := StringHolder new contents: self commentDefault]!
>> 
>> Item was added:
>> + ----- Method: PackageInfo>>comment: (in category 'preamble/postscript') -----
>> + comment: aString
>> +       comment := StringHolder new contents: aString!
>> 
>> Item was added:
>> + ----- Method: PackageInfo>>commentDefault (in category 'preamble/postscript') -----
>> + commentDefault
>> +       ^ 'THIS PACKAGE HAS NO COMMENT'!
>> 
>> Item was added:
>> + ----- Method: PackageInfo>>hasComment (in category 'preamble/postscript') -----
>> + hasComment
>> +       ^ self isScript: comment not: self commentDefault!
>> 
>> 
> 





More information about the Squeak-dev mailing list