in reply to OO Pattern Container x Elements and Method Chaining
# method chaining $cont1->get_elem('name')->do_something(); # identical to $elem1 = $cont1->get_elem('name'); $elem1->do_something();
These are in fact identical, other than the temporary variable $elem1. Nothing about method chaining requires that the element know that it's contained by the container.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: OO Pattern Container x Elements and Method Chaining
by LanX (Saint) on Oct 08, 2021 at 15:31 UTC | |
by jdporter (Paladin) on Oct 08, 2021 at 15:52 UTC | |
by LanX (Saint) on Oct 08, 2021 at 16:02 UTC | |
by jdporter (Paladin) on Oct 13, 2021 at 03:53 UTC | |
by LanX (Saint) on Oct 13, 2021 at 11:42 UTC |
In Section
Seekers of Perl Wisdom