ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> squeak-list
squeak-list
Fix OB refactoring: Creating accessor change the instance/class variable
by Mathieu Suen other posts by this author
Aug 11 2007 6:00AM messages near this date
Re: OT (slightly) - Linux on a MacBookPro | Re: Fix OB refactoring: Creating accessor change the instance/class variable
Hi,

If you use the refactoring create  accessor for instance or class  
variable some time fails:

If you have a class define as:

Object subclass: #A
	instanceVariableNames: 'c b'
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Dummy'


And add A> >b: by hand.
After create the accessor for c with the refactoring in omnibrowser.

"A new b: 3"  will affect c and not b.
This is because ob-refactoring sort the instance variable to display  
in the alphabetical order:

ORCmdRefactoring> >instanceVariables
	^ (target isKindOf: OBInstanceVariableNode)
		ifTrue: [ Array with: target name ]
		ifFalse: [ target theClass instVarNames asArray sort ]

I have patched this method with the #asSortedArray. See the attached  
file

I think is the method #asArray who make the mess if you look at the  
implementation of Array> >#asArray.
I would rather expect a copy of self.


I have open an issue: http://bugs.squeak.org/view.php?id=6602
Thread:
Mathieu Suen
Lukas Renggli

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved