^((super new) initialize)

Ned Konz ned at bike-nomad.com
Sun Aug 19 13:57:19 UTC 2001


On Sunday 19 August 2001 06:06 am, you wrote:
> > Ned Konz
> >
> > Object subclass: #Person
> >   instanceVariableNames: 'name'
> >   classVariableNames: ''
> >   poolDictionaries: ''
> >   category: 'MyStuff'
> >
> > Gary, is this what you did?
>
> Yes, that's what I did. But I got some conflict with system variables
> 'name' and had to use personName. 'name' wouldn't be accepted.

There shouldn't have been any name instance variable in Object. Perhaps you 
added one by mistake.

> Because of overriding the 'new' method for my class, when I went to write
> something like 'dates := OrderedCollection new' the new method wouldn't
> work

What do you mean "didn't work"?

> I've discarded that image now, so cannot look at it again. It was quite
> embarrassing to see my image in such a pathetic state.
>
> I seemed to be doing everything right and didn't notice my mistake.

Well, it happens. Luckily, you can look at your changes, even if you've 
discarded the image (assuming that you've saved the .changes file).

> (By the way, using the parenthesis is commonly used in my course to aid
> readability. Now, I wouldn't want to give my examiner any openings to mark
> my scores down would I :o) ).

Has your examiner written Smalltalk before? It is common practice (read: 
everyone's code that I've seen) to _not_ use parentheses unless needed or in 
very complex expressions that would be hard to read otherwise. For instance, 
it adds no readability around a return value:

    ^someObj doSomething
vs.
  ^(someObj doSomething)

-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com




More information about the Squeak-dev mailing list