Hmm, I think we are getting away from the real issue. Finding a way to hook up lexicals with attributes is not the real point, though interesting in itself. The real point is to make a succinct way to declare instance data.

So, don't use an attributed declaration. Instead, use a syntax like: field ('name', options); that will create the underlying hash itself, rather than the caller making one.

The underlying hash can either be "hands off", or there can be a way to get to it (return value from that call?) if you really want to support it.

{ # extra scope $xx= field qw/xx private/; sub something { # I use that instance data internally. # ... ... $$xx{$id} ... }
Being private, no access method is autogenerated, and the returned ref is the only way to get to it.

—John


In reply to Re: Re: Class::InsideOut - yet another riff on inside out objects. by John M. Dlugosz
in thread Class::InsideOut - yet another riff on inside out objects. by adrianh

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":