Issue 3685 in pharo: #createUserSubclass:instVarNames:categoryName: no longer accepts an inst var array

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue 3685 in pharo: #createUserSubclass:instVarNames:categoryName: no longer accepts an inst var array

pharo
Status: New
Owner: ----

New issue 3685 by [hidden email]:  
#createUserSubclass:instVarNames:categoryName: no longer accepts an inst  
var array
http://code.google.com/p/pharo/issues/detail?id=3685

Pharo core version:
   Pharo1.2rc2
   Latest update: #12324

In Pharo1.1 the instance variables could be passed as an array. See  
attached testcase, or, for example:

   SomeClass createUserSubclass: 'SomeSubclass' instVarNames: #(id varOne  
varTwo) categoryName: 'Test'.

The code change here, looks to be the cause:

ClassBuilder>>name: className inEnvironment: env subclassOf: newSuper type:  
type instanceVariableNames: instVarString classVariableNames:  
classVarString poolDictionaries: poolString category: category unsafe:  
unsafe

< instVars := instVarString subStrings: ' '.
< classVars := (classVarString subStrings: ' ') collect: [ :x | x asSymbol  
]. "Validate the proposed name"
--
> instVars := Scanner new scanFieldNames: instVarString.
> classVars := (Scanner new scanFieldNames: classVarString) collect: [ :x  
> | x asSymbol ]. "Validate the proposed name"

This issue came up in some code that was originally derived from some  
GemStone code. Maybe it was never intended that instVarNames could be  
passed in as an array. I've changed my code to pass an instVarString, but I  
thought I'd mention the changed behaviour here.

Attachments:
        ClassBuilderFormatTests-testSubclassWithInstanceVariablesArray.st  565  
bytes


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3685 in pharo: #createUserSubclass:instVarNames:categoryName: no longer accepts an inst var array

pharo

Comment #1 on issue 3685 by [hidden email]:  
#createUserSubclass:instVarNames:categoryName: no longer accepts an inst  
var array
http://code.google.com/p/pharo/issues/detail?id=3685

Normally we should not pass array to class creation.


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3685 in pharo: #createUserSubclass:instVarNames:categoryName: no longer accepts an inst var array

pharo
Updates:
        Status: Fixed

Comment #2 on issue 3685 by [hidden email]:  
#createUserSubclass:instVarNames:categoryName: no longer accepts an inst  
var array
http://code.google.com/p/pharo/issues/detail?id=3685

(No comment was entered for this change.)


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3685 in pharo: #createUserSubclass:instVarNames:categoryName: no longer accepts an inst var array

pharo
Updates:
        Labels: Milestone-1.3

Comment #3 on issue 3685 by marianopeck:  
#createUserSubclass:instVarNames:categoryName: no longer accepts an inst  
var array
http://code.google.com/p/pharo/issues/detail?id=3685

(No comment was entered for this change.)


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3685 in pharo: #createUserSubclass:instVarNames:categoryName: no longer accepts an inst var array

pharo
Updates:
        Status: FixProposed

Comment #4 on issue 3685 by [hidden email]:  
#createUserSubclass:instVarNames:categoryName: no longer accepts an inst  
var array
http://code.google.com/p/pharo/issues/detail?id=3685

(No comment was entered for this change.)


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3685 in pharo: #createUserSubclass:instVarNames:categoryName: no longer accepts an inst var array

pharo
Updates:
        Status: WontFix

Comment #5 on issue 3685 by [hidden email]:  
#createUserSubclass:instVarNames:categoryName: no longer accepts an inst  
var array
http://code.google.com/p/pharo/issues/detail?id=3685

  Object subclass: self baseClassName
                instanceVariableNames: #(var var2)
                classVariableNames: ''
                poolDictionaries: ''
                category: 'Kernel-Tests-ClassBuilder'.

instanceVariableNames: #(var var2)

is not supported. It's a string... (yes, ugly)

We will change that when we move to Slots.