hello<br><br><br>aComplex := ComplexClass new.<br><br>and create a method &quot;new&quot; which override new<br><br>new<br>&nbsp;&nbsp;&nbsp; ^ super new initializer<br><br>and create a another method &quot;initializer&quot;<br><br>initializer
<br>&nbsp;&nbsp;&nbsp;&nbsp;| aVariable |<br>&nbsp;&nbsp;&nbsp;&nbsp;aVariable := ComplexClass new.<br>&nbsp;&nbsp;&nbsp;&nbsp;aVariable firstVariable: 22.<br>&nbsp;&nbsp;&nbsp;&nbsp;aVariable secondVariable: 23.<br>&nbsp;&nbsp;&nbsp;&nbsp;^aVariable<br><br><br><br><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br>------------------------------<br><br>Message: 10<br>Date: Sun, 13 Aug 2006 23:23:43 +0200<br>From: hypolit &lt;<a href="mailto:hypolit@googlemail.com">hypolit@googlemail.com</a>&gt;<br>Subject: [Newbies] Instance Creation Howto
<br>To: <a href="mailto:beginners@lists.squeakfoundation.org">beginners@lists.squeakfoundation.org</a><br>Message-ID:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;<a href="mailto:e4dc659c0608131423pfd5ecbak97309d93234a0261@mail.gmail.com">e4dc659c0608131423pfd5ecbak97309d93234a0261@mail.gmail.com
</a>&gt;<br>Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br><br>Hello,<br><br>I am new to Smalltalk and Squeak in general. After having started to read<br>&quot;Inside Smalltalk&quot; and &quot;Smalltalk by Example&quot; i came along two similar
<br>examples, which sound quite reasonable but don't seem to work in Squeak.<br>I want to create an instance of my own class &quot;ComplexClass&quot;.<br><br>It is defined like this:<br>Object subclass: #ComplexClass<br>&nbsp;&nbsp;&nbsp;&nbsp;instanceVariableNames: 'firstVar secondVar'
<br>&nbsp;&nbsp;&nbsp;&nbsp;classVariableNames: ''<br>&nbsp;&nbsp;&nbsp;&nbsp;poolDictionaries: ''<br>&nbsp;&nbsp;&nbsp;&nbsp;category: 'TestClass'<br><br><br>I can create instances with<br>aComplex := ComplexClass new.<br>normally.<br><br>But what if i wanted to call another method instead of &quot;new&quot; to create an
<br>instance?<br>Take, for example, my method &quot;initializer&quot;:<br><br>initializer<br>&nbsp;&nbsp;&nbsp;&nbsp;| aVariable |<br>&nbsp;&nbsp;&nbsp;&nbsp;aVariable := ComplexClass new.<br>&nbsp;&nbsp;&nbsp;&nbsp;aVariable firstVariable: 22.<br>&nbsp;&nbsp;&nbsp;&nbsp;aVariable secondVariable: 23.
<br>&nbsp;&nbsp;&nbsp;&nbsp;^aVariable<br><br><br>In both books there are methods quite similar to my &quot;initializer&quot; method.<br>But if execute:<br><br>aComplex2 := ComplexClass initializer.<br><br>I get an error message, something like &quot;Undefined Object does not understand
<br>#initializer&quot;.<br>Do i have to write:<br><br>aComplex2 := ComplexClass new.<br>aComplex2 := aComplex2 initalizer.<br><br>That would work but it is quite ugly.</blockquote></div><br><br>