Should every kernel class x provide support for (x new) printString and (x new) hash

Bert Freudenberg bert at freudenbergs.de
Sun Jan 21 12:41:01 UTC 2007


Am Jan 21, 2007 um 11:51  schrieb Klaus D. Witzel:

> Hi folks,
>
> on the beginners list Brent McConnell reported a situation in which  
> (Collection new) was assigned to an automatic declared variable x  
> and a subsequent (x := OrderedCollection new) still called for the  
> dubugger, because aDictionary(Set) relies on ((Collection new)  
> hash) for already declared variables.

Interesting find - I couldn't believe it when I read it, but it is  
indeed as Brent says.

> You can provoke the walkback with printIt on
>
>  (Collection new) hash
>
> but also on
>
>  (Collection new)

IMHO that's not the actual problem at hand, but rather, that  
compiling an assignment breaks depending on the previous *value* of  
the binding. We should fix that. Reproduce be evaluating these two  
lines *separately* in a Workspace:

	c := Collection new

	c := 42

> Q: wouldn't it be noob-friendlier if *all* kernel classes avoided  
> the debugger in doIt/printIt situations?

You mean I should be able to write "1 / 0" and not get a debugger? ;-)

I don't think so. I also don't think that is necessary, I guess you  
try to instantiate an abstract Collection only once.

So my answer to your subject's question would be a clear "no". *If*  
we wanted to be newbie friendly we would make "Collection" an alias  
to "OrderedCollection" so you can actually work with it. I'd be  
opposed to that suggestion, too, of course ;)

- Bert -





More information about the Squeak-dev mailing list