[PEPr] Comment on Structures::Structures_Linked_List
| From: | Dan Scott | Date: | Sat, 16 Sep 2006 02:26:43 +0000 |
| Subject: | [PEPr] Comment on Structures::Structures_Linked_List | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-43954@lists.php.net to get a copy of this message | ||
Dan Scott (http://pear.php.net/user/dbs) has commented on the proposal for
Structures::Structures_Linked_List.
Comment:
David: I agree, a sorting method would be nice; I'm going to focus first on
ensuring that the existing code is stable and well-tested, but that ranks
high up there in priority. Also, I've added the type-hinting as you
suggested; it helped point out a few areas where I was being lax. Thanks!
Martin: You probably have to 'pear install --force' the package, as I put
pear.php.net in the package.xml and there's no way the md5sum exists on
pear.php.net before the package has been approved :)
I could consider Structures_Doubly_Linked_List as a package name; it just
seems pretty long and in a language where arrays dominate I have trouble
imagining anybody else wanting to contribute a singly linked list PEAR
package... but my imagination may be quite limited.
Scott: I was struggling to understand PEAR::Errorstack, so when I managed
to get it to work I was happy to return to focusing on the core code. My
intention was to revisit the error-handling after the proposal was
accepted and before going stable. After a few discussions with Pierre,
though, I believe I will switch the package to use exceptions to comply
with the previously accepted RFC on error handling for PHP 5 packages.
Which probably means doing some work on PEAR::Exception.
I'll revisit the addNode() API; you're right, having separate functions
instead of having to pass a special constant would make things easier. To
group the functions alphabetically, though, I'm thinking about something
like:
addNodeAppend()
addNodeInsert()
addNodePrepend()
Good point on the package name - I misread the _ per level of hierarchy
thing in the coding standards. I'll go through and rename everything once
we figure out it we want Structures_LinkedList_Double (to allow
Structures_LinkedList_Single, as Martin suggested) or just plain old
Structures_LinkedList.
When returning by reference (since PHP 5.1 I believe), the '$retval =
false; return $retval;' thing is necessary to avoid an E_STRICT warning
(Strict Standards: Only variables should be assigned by reference). And
I'm being a good boy and trying to be E_STRICT compatible :)
Proposal information:
http://pear.php.net/pepr/pepr-proposal-show.php?id=444
--
Sent by PEPr, the automatic proposal system at http://pear.php.net