^((super new) initialize)

Gary McGovern garywork at lineone.net
Sun Aug 19 15:50:19 UTC 2001


----- Original Message -----
From: "Ned Konz" <ned at bike-nomad.com>


> 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.

Maybe.

> > 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"?

The system seized up.


> > 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).

No, that went too.
I've just been messing around trying to recreate the problem and the nearest
I've gotten to my error is

^super initialize new.
I think that's what I've done with perhaps another error.

> > (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)

Well, I'm just the poor little student in all this. :o)
During the last week I read lots of examples with the parenthesis. But I
understand that more experienced Smalltalkers wouldn't bother with them
except for more complex code.

Regards,
Gary

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





More information about the Squeak-dev mailing list