Another question I want to add to my proposal is: should the code
references work by modifying $_ in-place (as with DBM filters) or should
the code take an argument and return a result. I think I lean towards
the modification of $_ in-place as it seems a little more Perlesque.
Cheers,
Sterling
On Thu, 2003-12-18 at 12:01, Andrew Sterling Hanenkamp wrote:
> I would like to revise my original query into a proposal in light of the
> comments I've received to now suggest a Tie::Filter namespace for
> filtering Tie classes. There could be specialized classes
> Tie::Filter::Scalar, Tie::Filter::Array, Tie::Filter::Hash, and
> Tie::Filter::Handle.
>
> However, at this point, this project is becoming far more serious than
> the original idea and I think I'm going to need an actual design for
> each of these. The implementations will all be tiny, but I want an
> interface that seems natural. Really, the only API that these modules
> have to come up with are the arguments to tie, so I propose the
> following syntax for calls to tie:
>
> For all Tie::Filter classes, the first argument will always be a
> reference to the wrapped object. 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.)
>
> 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
>
> I think I like these keys better than the -inflate*/-deflate* ones I
> presented before.
>
> Any other suggestions? I'll keep working on this and am glad to take any
> other suggestions. Thank you all for your suggestions; they have been
> very helpful.
>
> Regards,
> Sterling
--
<>< ><> <>< ><> <>< ><> <>< ><> <>< ><> <>< ><> <>< ><> <>< ><> <>< ><>
Andrew Sterling Hanenkamp
http://Andrew.Sterling.Hanenkamp.com/
[EMAIL PROTECTED] / [EMAIL PROTECTED]
Microsoft is a cross between the Borg and the Ferengi.
Unfortunately, they use Borg to do their marketing and Ferengi to
do their programming.
-- Simon Slavin