[cl-containers-devel] darcs patch: When searching for an item in a bst, make sure that th...

Nathan Bird nathan at acceleration.net
Fri Mar 6 19:51:43 UTC 2009


On 3/6/2009 12:10 PM, Nathan Bird wrote:
> Fri Mar  6 11:52:50 EST 2009  Nathan Bird<nathan at acceleration.net>
>    * When searching for an item in a bst, make sure that the node isn't a placeholder and actually has an element
>    
The point of this is that because the red black tree has empty nodes as 
placeholders we need to test for that. Without this searching a red 
black tree for an element it doesn't contain doesn't return null, but 
errors.

 > (containers:item-at (containers:make-container 
'containers:red-black-tree) 1)

Alternatively to testing the element slot directly, there appears to be 
a node-empty-p function that might be more appropriate.




More information about the cl-containers-devel mailing list