I wrote another more in-depth (but potentially less useful to you) mail
about this further down the thread, but I thought it'd be good to point
this out near the top:

I think the /self.bless(|%args)!initialize/ idiom is a work-around for
/submethod TWEAK/ not yet existing when this code was written. /TWEAK/
works in a very similar manner, with these differences:

1) Your "/self/" isn't fully built when /TWEAK/ runs, therefore you
can't call regular methods on it
2) It will even be executed when a subclass of your class gets
constructed, whereas there's no simple way to get access to !initialize
from a subclass.
3) TWEAK gets passed the named parameters that bless was called with

/method new/ is useful only if you want to take positional parameters
for the .new — the default new you get from /Mu/ only accepts named
arguments and passes them on as-is to /self.bless/. They then get passed
to every /BUILD/ and /TWEAK/ in the inheritance chain. The named
parameters don't have to correspond to attribute names, as you can do
any private attribute assignment in /TWEAK/ that you like.//

I hope that helps
  - Timo

Reply via email to