But, if the whole pack/unpack thing is moved out of the core, why does there have to be only one way to do it?.
That is, suppose the existing pack/unpack functions were supplied externally and you pulled it in, if desired, with use Legacy::Packing qw/pack unpack/;. You could have a totally different, unrelated, body of code to implement something fancy like RFC 142. There could be many different modules for this purpose.
OK, now here's my meta-feature.
Define a overall standard way to register types used for packing/unpacking. All pack/unpack type of modules would look in this same place for these definitions.
So, suppose I write class MyType and include methods to serialize and unserialize in a binary form. As the creator of that class, registering this fact once should make it available to any packing module.
Perhaps, ${^PACKING}{MyType}= [\&from_sub, \&to_sub ]; (using the current Perl5 syntax).
Now whether someone uses RFC 142's module and refers to that typename in a definition, or someone does a (hypothetical) Legacy::Packing->addtype (e => 'MyType');, that definition is available and more importantly, written by that type's provider.
—John
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl 6 wish list: pack/unpack meta-feature
by tadman (Prior) on Jul 26, 2001 at 08:28 UTC | |
by John M. Dlugosz (Monsignor) on Jul 26, 2001 at 08:42 UTC | |
|
Re: Perl 6 wish list: pack/unpack meta-feature (boo)
by boo_radley (Parson) on Jul 26, 2001 at 17:36 UTC | |
by John M. Dlugosz (Monsignor) on Jul 26, 2001 at 19:08 UTC |