[squeak-dev] [M7634] Cannot revert a class comment

Frank Shearar frank.shearar at angband.za.org
Fri May 6 15:16:23 UTC 2011


On 2011/05/06 16:10, Levente Uzonyi wrote:
> On Fri, 6 May 2011, Frank Shearar wrote:
>
>> http://bugs.squeak.org/view.php?id=7634 says
>>
>> Find a class with a class comment. Edit the comment. Click "versions".
>> Revert to an earlier version.
>>
>> "NonBooleanReceiver: proceed for truth." because instvar meta in
>> ChangeRecord>>methodClass has as its value the class you're currently
>> editing, rather than a boolean!
>>
>> Now ClassCommentVersionBrowser>>#scanVersionsOf: says this:
>>
>> self addItem:
>> (ChangeRecord new file: file position: position type: #classComment
>> class: class name category: nil meta: class stamp: stamp)
>>
>> I can see two possible solutions: pass "class" or "class class" into
>> the meta: parameter, or change ChangeRecord>>#methodClass to say
>
> The meta variable should be a boolean, so false should be passed. This
> is a bug since 2003 or earlier.
>
>>
>> meta ifTrue: [ ^ methodClass class ].
>> ^ methodClass.
>
> The above code doesn't work if meta is not a boolean.

You're right.

meta == true ifTrue: [ ^ methodClass class ].
^ methodClass.

is what I meant :) Which highlights the ugliness of meta being a Boolean 
sometimes, and other times not.

frank

> Levente
>
>>
>> I prefer the latter: ClassCommentVersionBrowser>>#scanVersionsOf: has
>> been around for years, and changing ChangeRecord makes things more
>> robust in the face of anything else being a non-Boolean.
>>
>> The downside is that meta almost always contains a Boolean... except
>> when (like now) it doesn't.
>>
>> Thoughts?
>>
>> frank
>>
>>
>
>
>




More information about the Squeak-dev mailing list