[% setvar title unified container theory %]

This file is part of the Perl 6 Archive

Note: these documents may be out of date. Do not use as reference!

To see what is currently happening visit http://www.perl6.org/

TITLE

unified container theory

VERSION

  Maintainer: David Nicol <perl6rfc@davidnicol.com>
  Date: 28 Sep 2000
  Mailing List: perl6-language-data@perl.org
  Number: 341
  Version: 1
  Status: Developing

ABSTRACT

Viewing Hash and Array as instances of "Container" leads to easy implementation of "Sparse Array" and "Sorted Hash" and "Real Array"

DESCRIPTION

There are two big differences between Hash and Array.

IMPLEMENTATION

With this in mind, it becomes possible to consider implementing both container types as sorted trees, possibly transparently switching to block offset arrays when Array is sufficiently dense.

The one tree framework could be used for both types of trees, by switching the comparison function.

Tree search may be faster than hash function calculation for easily compared data.

REFERENCES

The above is written from memory of conversation in August on perl6-internals.