Hi all. I've enjoyed(?) reading over the February/March thread
entitled "Musings on operator overloading". I've brought a few thoughts
along; if they're old news, please tell me where to do more reading on it :).
Over the last year or two, I've discovered XPath. I've always thought
XML a little annoying, but I'm very impressed with XPath (which I regard as
"the glob() of XML"), and I've been wondering how to get the power of XPath in
relation to *all* data, not just XML.
My eventual thought was that what would be useful is a role called
Plex (for those who aren't familiar with a Plex, just think "Tree" and you'll
have the right idea). The basic idea is that the Plex role could have a
variety of implementors depending on the data desired (much like the DBI/DBD
split, but for trees instead of tables). The backends could of course include
filesystems, but also XML, LDAP, OO databases, and DNS domains.
Tabular data could also be mapped into trees if desired. This could
be anything from SQL to text files.
As an additional idea, backend conversion could be performed. This
would be especially useful in the case of files. For example:
$root/etc/fstab <convert to text table> / "/boot"
...which would select the row from fstab that contains the "/boot"
partition; admittedly I've fudged the conversion here.
As you can see from my example, my idea is also that then there could
be Plex operators which would select out the data desired. In the example
above, it would be necessary for / to be a combination of a flow operator and
a variadic function that takes string and codeblock parameters; it returns a
list of values which are all Plex::Node.
Btw, it was quite a long time before I was able to find the operator
overloading documentation; "Subroutines" was not an intuitive place to look
:). Is there any chance we could add something to S03 that says something
like "see S06 and S13 for operator overloading"?
:)
---------------------------------------------------------------------
| Name: Tim Nelson | Because the Creator is, |
| E-mail: [EMAIL PROTECTED] | I am |
---------------------------------------------------------------------
----BEGIN GEEK CODE BLOCK----
Version 3.12
GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V-
PE(+) Y+>++ PGP->+++ R(+) !tv b++ DI++++ D G+ e++>++++ h! y-
-----END GEEK CODE BLOCK-----