具有导航、编辑和枚举功能的分层拉链。见休伊特
zipper的Python项目详细描述
拉链[![构建状态](https://travis ci.org/trivio/zippers.png)(https://travis ci.org/trivio/zippers)
==
huet首先描述的数据结构用于遍历和操作不可变树。这个库是在clojure中找到的zippers
实现的一个端口。
usage
----
zippers模块提供了几个函数来创建一个loc对象,该对象表示树中当前的焦点。
`````
>; >;>top=zippers.list([1,[2,3],4])
>;>print top.down().right().node()
[2,3]
>;>print top.down().right().down().node()
2
>;>print top.down().right().down().replace(0.root()
[1,[0,3],4]
```
==
huet首先描述的数据结构用于遍历和操作不可变树。这个库是在clojure中找到的zippers
实现的一个端口。
usage
----
zippers模块提供了几个函数来创建一个loc对象,该对象表示树中当前的焦点。
`````
>;
>;>print top.down().right().node()
[2,3]
>;>print top.down().right().down().node()
2
>;>print top.down().right().down().replace(0.root()
[1,[0,3],4]
```