[Seaside-dev] basicNew

Randal L. Schwartz merlyn at stonehenge.com
Mon Sep 29 19:50:39 UTC 2008


>>>>> "Avi" == Avi Bryant <avi at dabbledb.com> writes:

Avi> On Mon, Sep 29, 2008 at 12:43 PM, Randal L. Schwartz
Avi> <merlyn at stonehenge.com> wrote:

Avi> Change super to self in this method, and (given the rest of the code
Avi> in my example) you would have infinite recursion.
>> 
>> I didn't see that you had a local initialize.  If you had, then
>> *it* should have been the one to have super initialize, since the local
>> initialize is superceding it by extension.

Avi> And what would the rest of that method look like?  What would the
Avi> other methods look like?
Avi> This is a fairly intricate convention and it doesn't make sense to
Avi> look at an individual piece of it in isolation.  If you're arguing
Avi> that the local initialize should call its super method, can you also
Avi> show what the rest of this (tiny) example would look like so I can
Avi> understand the entire control flow you're proposing?

  YourClass >> initialize
    super initialize.
    self initalizeWithX: 0 andY: 0.
    ^self. "implied if absent"

  YourClass >> initalizeWithX: x andY: y
    self x: x.
    self y: y.

There.  Now super is called in the right place... by the method that
is overriding it.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion


More information about the seaside-dev mailing list