* Andrew Sterling Hanenkamp <[EMAIL PROTECTED]> [2003-12-18 19:02]:
> However, at this point, this project is becoming far more serious than
> the original idea

Which is always good when code's meant to go onto CPAN :-)

> The wrapped object must be of the same type as the tie itself
> since the Tie::Filter class does the work of actually
> manipulating the internal object.  (Becoming any more general
> and we've just invented a new way of implementing a tied object
> and I don't really think that's necessary.)

I do, because for simple one-off uses, the standard mechanism
requires too much baggage. Sometimes I'd like to use tieing in a
10-line script; not having to create a package and populate it
with a half dozen subs, which is alone 15 lines of red tape -
that would be neat.

But then, this is Tie::Filter, not Tie::Simple, and I agree it
doesn't really fall in the scope of this module suite.

> Tie::Filter::Scalar:
> 
> tie $scalar, 'Tie::Filter::Scalar', \$wrapped,
>       INFLATE => sub { ... },
>       DEFLATE => sub { ... },
> 
> Tie::Filter::Array:
> 
> tie @array, 'Tie::Filter::Array', [EMAIL PROTECTED],
>       INFLATE => sub { ... },
>       DEFLATE => sub { ... };
> 
> Tie::Filter::Hash:
> 
> tie %hash, 'Tie::Filter::Hash', \%wrapped,
>       INFLATEKEY => sub { ... },
>       DEFLATEKEY => sub { ... },
>       INFLATEVALUE => sub { ... },
>       DEFLATEVALUE => sub { ... };
> 
> Tie::Filter::Handle:
> 
> tie $handle, 'Tie::Filter::Handle', \$handle,
>       INFLATE => sub { ... }, # stream read
>       DEFLATE => sub { ... }; # stream write

You could DWIM on the type of variable you're tying to (or the
type of variable you're wrapping, which is the same), so people
could just say 'Tie::Filter' and have their variables tied to an
object of the right class.

> I think I like these keys better than the -inflate*/-deflate*
> ones I presented before.

I like them better as well, but I think (in|de)flate is too
specific considering the generic nature of these filtering tie
modules. I can't think of any better terminology of my own; maybe
it would be best to simple reuse the names we're already familiar
with in Perl: (FETCH|STORE)(KEY|VALUE)?.

-- 
Regards,
Aristotle
 
"If you can't laugh at yourself, you don't take life seriously enough."

Reply via email to