Timothy S. Nelson wrote: > 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.
Sometimes I wish for something similar. Perl 5's Data::Diver goes a bit in that direction, but it's not nearly as flexible as XPath. > 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. It sounds like a perfect idea for a very general library or rather library framework. Perl 6 has all the hooks to install stuff like this. > 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 When you know that operators are mostly[1] just weirdly named subs, it is ;-) > :). Is there any chance we could add something to S03 that says something > like "see S06 and S13 for operator overloading"? That would be mainly Larry's decision. Other ways to search in the Synopsis are * check out a copy of the svn repo, and grep/ack in them * ask in #perl6 where some particular item is documented Sadly we have next to no user-level documentation at them moment. The closest might be the open sourced version of "Perl 6 and Parrot Essentials", but it's rather incomplete and some parts are quite out of date. [1] some operators like ~~ actually have more macroish semantics -- Moritz Lenz http://perlgeek.de/ | http://perl-6.de/ | http://sudokugarden.de/