https://github.com/pharo-containers/Containers-KeyedTree
An implementation of KeyedTree
https://github.com/pharo-containers/Containers-KeyedTree
collections pharo
Last synced: 2 months ago
JSON representation
An implementation of KeyedTree
- Host: GitHub
- URL: https://github.com/pharo-containers/Containers-KeyedTree
- Owner: pharo-containers
- Created: 2018-05-01T19:07:55.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2025-05-02T08:33:21.000Z (2 months ago)
- Last Synced: 2025-05-02T09:43:32.157Z (2 months ago)
- Topics: collections, pharo
- Language: Smalltalk
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-pharo - KeyedTree
README
# Containers-KeyedTree
An implementation of KeyedTree[](https://travis-ci.com/Ducasse/Containers-KeyedTree)
[](https://coveralls.io/github//Ducasse/Containers-KeyedTree?branch=master)
[]()
[](https://pharo.org/download)
[](https://pharo.org/download)## Example
To have an overview of the features this datastructure provide, have a look at the following code snippet (extracted from a unit test):```st
firstLevelOneSubTree := CTKeyedTree new.
firstLevelOneSubTree
at: #two put: 'One-Two';
at: #three put: 'One-Three'.
tree := CTKeyedTree new.
tree
at: 1 put: firstLevelOneSubTree;
at: 2 put: 'Two'.
self assert: (tree atPath: #(1)) equals: firstLevelOneSubTree.
self assert: (tree atPath: #(1 two)) equals: 'One-Two'.
self assert: (tree atPath: #(1 three)) equals: 'One-Three'.
self assert: (tree atPath: #(2)) equals: 'Two'.
self should: [ tree atPath: #(2 4) ] raise: self defaultTestError.
self should: [ tree atPath: #(1 two three) ] raise: self defaultTestError.
self should: [ tree atPath: #(3) ] raise: self defaultTestError
```## Loading
The following script installs Containers-Stack in Pharo.
```st
Metacello new
baseline: 'ContainersKeyedTree';
repository: 'github://pharo-containers/Containers-KeyedTree:v1.0/src';
load.
```## If you want to depend on it
Add the following code to your Metacello baseline or configuration
```
spec
baseline: 'ContainersKeyedTree'
with: [ spec repository: 'github://pharo-containers/Containers-KeyedTree:v1.0/src' ]
```