Re: API Thoughts?

From: Date: Sun, 26 Aug 2001 23:42:04 +0000
Subject: Re: API Thoughts?
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-64369@lists.php.net to get a copy of this message
On Sun, 26 Aug 2001, Jon Parise wrote: > On Sun, Aug 26, 2001 at 07:29:59PM -0400, Sterling Hughes wrote: > > > Hey, > > extension and was wondering what people thought as more intuitive, > > something like: > > > > $tree = tree_new(AVL_TREE); > > tree_insert($tree, $element, "compare_func"); > > // ... > > I prefer this notation. There's more room for future expansion > without encroaching on namespace. > > I think it would be neat to be able to do this, though: > > $tree = new Tree(AVL_TREE); > $tree->insert($element, 'compare_func'); > > But such a wrapper shouldn't be too difficult to write. > > Jep -- I'm writing PEAR OO wrappers for every ADT that I implement in a functional manner. I'm think for the OO wrappers, seperate class names wouldn't be horrible, something like: $tree = new AVLTree; -Sterling

« previous php.dev (#64369) next »