Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.perl.modules > #225

a new Tree::Interval-like module on top of Tree::RB?

From Ivan Shmakov <oneingray@gmail.com>
Newsgroups comp.lang.perl.modules, comp.lang.perl.misc
Subject a new Tree::Interval-like module on top of Tree::RB?
Date 2013-06-13 17:13 +0000
Organization Aioe.org NNTP Server
Message-ID <87ip1igchz.fsf@violet.siamics.net> (permalink)

Cross-posted to 2 groups.

Show all headers | View raw


	So, I've crafted the base for a Tree::Interval-like module,
	implemented on top of Tree::RB, and I'm open to suggestions of
	what'd be a suitable name for it?

	The obvious candidates are Tree::RB::Interval and
	Tree::Interval::RB, but I'm uncertain if it'd be nice to
	infiltrate someone's else CPAN namespace in this case.

	FWIW, Tree::Interval::RB seems more appropriate, as the code as
	it is requires only the compare, delete, insert and lookup
	methods from the "backend," and thus could probably be not that
	hard to generalize.  (Although the lookup method is expected to
	allow for "imprecise" matching, and then it demands a way to
	iterate onwards from the node found...)

	A nice feature of this code is that it relies on the tree's own
	"compare" function, which could be rather arbitrary.  Thus, it's
	possible to, say:

    my $map
        = XXX->new (...);
    $map->set ("from", "to", "value");
    my $a
        = $map->lookup ("fuzzy");
    ## => "value"

	(provided that the tree is built around the "cmp" function.)

	TIA.

-- 
FSF associate member #7257	np. faceday.mod

Back to comp.lang.perl.modules | Previous | NextNext in thread | Find similar | Unroll thread


Thread

a new Tree::Interval-like module on top of Tree::RB? Ivan Shmakov <oneingray@gmail.com> - 2013-06-13 17:13 +0000
  Tree::Range 0.1 released Ivan Shmakov <oneingray@gmail.com> - 2013-06-27 05:27 +0000
    Re: Tree::Range 0.1 released Ben Morrow <ben@morrow.me.uk> - 2013-06-27 07:47 +0100
      Re: Tree::Range 0.1 released Ivan Shmakov <oneingray@gmail.com> - 2013-06-27 08:12 +0000
        Re: Tree::Range 0.1 released Ben Morrow <ben@morrow.me.uk> - 2013-06-27 11:24 +0100
          Re: Tree::Range 0.1 released Ivan Shmakov <oneingray@gmail.com> - 2013-06-27 11:05 +0000
            Re: Tree::Range 0.1 released Ben Morrow <ben@morrow.me.uk> - 2013-06-27 12:50 +0100
              Re: Tree::Range 0.1 released Ivan Shmakov <oneingray@gmail.com> - 2013-06-27 13:11 +0000
                Benchmark-ing Tree::Range::RB? Ivan Shmakov <oneingray@gmail.com> - 2013-07-02 19:37 +0000

csiph-web