Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^9: Class::InsideOut - yet another riff on inside out objects.

by adrianh (Chancellor)
on Dec 22, 2002 at 11:17 UTC ( #221728=note: print w/ replies, xml ) Need Help??


in reply to Re^8: Class::InsideOut - yet another riff on inside out objects.
in thread Class::InsideOut - yet another riff on inside out objects.

Hmmm... this sort of stuff falls over the 80/20 sweet spot for me. I would probably add a hook so sub-classes can customise how accessors/mutators are created. That way you could have:

package Foo; use base(Class::InsideOut::SetterGetter); sub new { bless [], shift }; my %Foo : Field(rw); package Bar; use base(Class::InsideOut::Lvalue); sub new { bless [], shift }; my %Bar : Field(rw); package main; my $foo = Foo->new; my $bar = Bar->new; $foo->set_foo(12); print $foo->get_foo, "\n"; $bar->bar = 42; print $bar->bar, "\n";


Comment on Re^9: Class::InsideOut - yet another riff on inside out objects.
Download Code
Re^10: Class::InsideOut - yet another riff on inside out objects.
by Aristotle (Chancellor) on Dec 22, 2002 at 11:32 UTC
    That's cool too - actually, I like it better.

    Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://221728]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (11)
As of 2014-09-17 11:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (72 votes), past polls