首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

clojure.zip

完整名称空间名称:clojure.zip

概述

代码语言:javascript
复制
Functional hierarchical zipper, with navigation, editing,
and enumeration.  See Huet

公共变量和函数

append-child 函数

代码语言:javascript
复制
Usage: (append-child loc item)
代码语言:javascript
复制
Inserts the item as the rightmost child of the node at this loc,
without moving

在Clojure版本1.0中添加

branch?函数

代码语言:javascript
复制
Usage: (branch? loc)
代码语言:javascript
复制
Returns true if the node at loc is a branch

在Clojure版本1.0中添加

children函数

代码语言:javascript
复制
Usage: (children loc)
代码语言:javascript
复制
Returns a seq of the children of node at loc, which must be a branch

在Clojure版本1.0中添加

down函数

代码语言:javascript
复制
Usage: (down loc)
代码语言:javascript
复制
Returns the loc of the leftmost child of the node at this loc, or
nil if no children

在Clojure版本1.0中添加

编辑函数

代码语言:javascript
复制
Usage: (edit loc f & args)
代码语言:javascript
复制
Replaces the node at this loc with the value of (f node args)

在Clojure版本1.0中添加

end?函数

代码语言:javascript
复制
Usage: (end? loc)
代码语言:javascript
复制
Returns true if loc represents the end of a depth-first walk

在Clojure版本1.0中添加

insert-child功能

代码语言:javascript
复制
Usage: (insert-child loc item)
代码语言:javascript
复制
Inserts the item as the leftmost child of the node at this loc,
without moving

在Clojure版本1.0中添加

insert-left函数

代码语言:javascript
复制
Usage: (insert-left loc item)
代码语言:javascript
复制
Inserts the item as the left sibling of the node at this loc,
without moving

在Clojure版本1.0中添加

insert-right函数

代码语言:javascript
复制
Usage: (insert-right loc item)
代码语言:javascript
复制
Inserts the item as the right sibling of the node at this loc,
without moving

在Clojure版本1.0中添加

left函数

代码语言:javascript
复制
Usage: (left loc)
代码语言:javascript
复制
Returns the loc of the left sibling of the node at this loc, or nil

在Clojure版本1.0中添加

leftmost函数

代码语言:javascript
复制
Usage: (leftmost loc)
代码语言:javascript
复制
Returns the loc of the leftmost sibling of the node at this loc, or self

在Clojure版本1.0中添加

lefts函数

代码语言:javascript
复制
Usage: (lefts loc)
代码语言:javascript
复制
Returns a seq of the left siblings of this loc

在Clojure版本1.0中添加

make-node功能

代码语言:javascript
复制
Usage: (make-node loc node children)
代码语言:javascript
复制
Returns a new branch node, given an existing node and new
children. The loc is only used to supply the constructor.

在Clojure版本1.0中添加

next函数

代码语言:javascript
复制
Usage: (next loc)
代码语言:javascript
复制
Moves to the next loc in the hierarchy, depth-first. When reaching
the end, returns a distinguished loc detectable via end?. If already
at the end, stays there.

在Clojure版本1.0中添加

节点函数

代码语言:javascript
复制
Usage: (node loc)
代码语言:javascript
复制
Returns the node at loc

在Clojure版本1.0中添加

path函数

代码语言:javascript
复制
Usage: (path loc)
代码语言:javascript
复制
Returns a seq of nodes leading to this loc

在Clojure版本1.0中添加

prev函数

代码语言:javascript
复制
Usage: (prev loc)
代码语言:javascript
复制
Moves to the previous loc in the hierarchy, depth-first. If already
at the root, returns nil.

在Clojure版本1.0中添加

移除函数

代码语言:javascript
复制
Usage: (remove loc)
代码语言:javascript
复制
Removes the node at loc, returning the loc that would have preceded
it in a depth-first walk.

在Clojure版本1.0中添加

替换函数

代码语言:javascript
复制
Usage: (replace loc node)
代码语言:javascript
复制
Replaces the node at this loc, without moving

在Clojure版本1.0中添加

right函数

代码语言:javascript
复制
Usage: (right loc)
代码语言:javascript
复制
Returns the loc of the right sibling of the node at this loc, or nil

在Clojure版本1.0中添加

rightmost函数

代码语言:javascript
复制
Usage: (rightmost loc)
代码语言:javascript
复制
Returns the loc of the rightmost sibling of the node at this loc, or self

在Clojure版本1.0中添加

rights函数

代码语言:javascript
复制
Usage: (rights loc)
代码语言:javascript
复制
Returns a seq of the right siblings of this loc

在Clojure版本1.0中添加

根函数

代码语言:javascript
复制
Usage: (root loc)
代码语言:javascript
复制
zips all the way up and returns the root node, reflecting any
changes.

在Clojure版本1.0中添加

SEQ-zip函数

代码语言:javascript
复制
Usage: (seq-zip root)
代码语言:javascript
复制
Returns a zipper for nested sequences, given a root sequence

在Clojure版本1.0中添加

up函数

代码语言:javascript
复制
Usage: (up loc)
代码语言:javascript
复制
Returns the loc of the parent of the node at this loc, or nil if at
the top

在Clojure版本1.0中添加

矢量-压缩函数

代码语言:javascript
复制
Usage: (vector-zip root)
代码语言:javascript
复制
Returns a zipper for nested vectors, given a root vector

在Clojure版本1.0中添加

xml-zip函数

代码语言:javascript
复制
Usage: (xml-zip root)
代码语言:javascript
复制
Returns a zipper for xml elements (as from xml/parse),
given a root element

在Clojure版本1.0中添加

zipper函数

代码语言:javascript
复制
Usage: (zipper branch? children make-node root)
代码语言:javascript
复制
Creates a new zipper structure. 

branch? is a fn that, given a node, returns true if can have
children, even if it currently doesn't.

children is a fn that, given a branch node, returns a seq of its
children.

make-node is a fn that, given an existing node and a seq of
children, returns a new branch node with the supplied children.
root is the root node.

在Clojure版本1.0中添加

扫码关注腾讯云开发者

领取腾讯云代金券