From d875ed6ccadd68ff9690533684ee1c91ad977a9d Mon Sep 17 00:00:00 2001 From: Drahflow Date: Sun, 1 Mar 2015 02:12:16 +0100 Subject: Trees now work. --- doc/container.md | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/doc/container.md b/doc/container.md index eb5961d..1910832 100644 --- a/doc/container.md +++ b/doc/container.md @@ -104,7 +104,36 @@ done via `has`. Trees ----- -Trees provide mapping from integers (FIXME: will allow strings soon) to arbitrary objects, -keeping the keys in `le` ascending order. Otherwise they should work just as maps. +Trees provide mapping from keys to arbitrary objects, +keeping the keys in `lt`/`eq`/`gt` ascending order. Otherwise they should work just as maps. -FIXME: Example will be provided once string-keys are supported. + tree ==t + 1 /foo t =[] + 2 /bar t =[] + t dump + + t dom dump + [ + "bar" + "foo" + ] + t |dump each + 0000000000000002 + 0000000000000001 + /foo t * dump + 0000000000000001 + /foo t .has dump + 0000000000000001 + /FOO t .has dump + 0000000000000000 + t 2 mul ==t2 + t2 dom dump + [ + "bar" + "foo" + ] + t2 |dump each + 0000000000000004 + 0000000000000002 + /foo t2 * dump + 0000000000000002 -- cgit v1.2.3