Re: API Thoughts?

From: Date: Sun, 26 Aug 2001 23:42:21 +0000
Subject: Re: API Thoughts?
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-64367@lists.php.net to get a copy of this message
On Sun, Aug 26, 2001 at 07:29:59PM -0400, Sterling Hughes wrote : > Currently working on the Binary Tree implementations for the ADT > extension and was wondering what people thought as more intuitive, > something like: > > $tree = tree_new(AVL_TREE); > tree_insert($tree, $element, "compare_func"); > // ... > > Or: > > $tree = avl_tree_new(); > avl_tree_insert($tree, $element, "compare_func"); > > Basically the difference between a generalized tree api, where you > pass a constant to the constructor (if you allow me to use that term > :), or where every form of the tree has a different set of functions > (currently planned are Red-black tree's, AVL tree's, Simple Binary > Search Tree's and Btree's). > > Thoughts? I'm currently leaning towards the first one... +1

« previous php.dev (#64367) next »