perl-unicode

Re: In-Band Information Considered Harmful

1998-10-23 15:34:21
Chip Salzenberg writes:
What structure?  Emacs can have an arbitrary hash associated to any
char.  Tk can have arbitrary number of bits associated to any char,
and an arbitrary hash associated to the ordinal of the bit ....

The only things I'm quite sure of is that metadata should be allowed
to have strings for names (is that true of Emacs?

It can have an arbitrary symbol (which is basically what shared hash
keys of Perl do), so I think the answer is "yes".

it seems not), not
just numbers (so the Tk scheme isn't good enough)

The Tk scheme (which you removed) *is* good enough.  Just create a
hash for each key, and associate the bit corresponding to this hash to
a given char.

Say, to (substr $str,$n, 1) associate number 2**$n, and associate to
bit 2**$n hash %{"hash$n"}.

and that creation and modification of metadata should be allowed to
include attachment of arbitrary Perl constructs (hashes, arrays,
whatever) to the metadata.

This is possible with both approaches (since they are semantically
equivalent, the difference is the space efficiency only).  Associate a
hash with one key 'PerlData', and the value you want.

Ilya