logo       

overwriting #new: msg#00077

lang.smalltalk.squeak.beginners

Subject: overwriting #new

-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Hello,

I have a class Foo inherited from Object. When I try to create a user
defined #new (newFoo), to avoid the #initialize instance method to run
as part of the object instantiation, I get the following error:
... class(Object)>>doesNotUnderstand: #newFoo ...

method definition:
- --------------
newFoo
| model|
model := self basicNew.
.. do something ..
model initialize.
^model
- --------------
usage:
someMethod
| foo |
foo := Foo newFoo.
.. do something ..
- --------------

Is there something that I missed to overwrite the #new method?

Cheers,
Daniel.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGlpV2gUMEmDMCeAARA5uvAKCDAw6ag+qHEDrFce8EjNKjD+QYbQCfZVLw
OypIlyLFBLJOLB/rIktphwI=
=Rfyg
-----END PGP SIGNATURE-----


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise