@@ -208,31 +208,31 @@ ROOT is the root node."
208
208
209
209
(defun treepy-branch-p (loc )
210
210
" Return t if the node at LOC is a branch."
211
- (funcall (treepy--meta loc ' :branchp ) (treepy-node loc)))
211
+ (funcall (treepy--meta loc :branchp ) (treepy-node loc)))
212
212
213
213
(defun treepy-children (loc )
214
214
" Return a children list of the node at LOC, which must be a branch."
215
215
(if (treepy-branch-p loc)
216
- (funcall (treepy--meta loc ' :children ) (treepy-node loc))
216
+ (funcall (treepy--meta loc :children ) (treepy-node loc))
217
217
(error " Called children on a leaf node " )))
218
218
219
219
(defun treepy-make-node (loc node children )
220
220
" Return a new branch node.
221
221
Given an existing LOC, NODE and new CHILDREN, creates a new LOC
222
222
with them. The LOC is only used to supply the constructor."
223
- (funcall (treepy--meta loc ' :make-node ) node children))
223
+ (funcall (treepy--meta loc :make-node ) node children))
224
224
225
225
(defun treepy-path (loc )
226
226
" Return a list of nodes leading to the given LOC."
227
- (reverse (treepy--context loc ' :pnodes )))
227
+ (reverse (treepy--context loc :pnodes )))
228
228
229
229
(defun treepy-lefts (loc )
230
230
" Return a list of the left siblings of this LOC."
231
- (reverse (treepy--context loc ' :l )))
231
+ (reverse (treepy--context loc :l )))
232
232
233
233
(defun treepy-rights (loc )
234
234
" Return a list of the right siblings of this LOC."
235
- (treepy--context loc ' :r ))
235
+ (treepy--context loc :r ))
236
236
237
237
; ;;; Navigation
238
238
@@ -261,7 +261,7 @@ nil if at the top."
261
261
(if changed?
262
262
(cons (treepy-make-node loc pnode
263
263
(treepy--join-children l (cons node r)))
264
- (and ppath (treepy--context-assoc ppath ' :changed? t )))
264
+ (and ppath (treepy--context-assoc ppath :changed? t )))
265
265
(cons pnode ppath))
266
266
(treepy--meta loc))))))
267
267
@@ -289,8 +289,8 @@ nil if there's no more right siblings."
289
289
(treepy--with-meta
290
290
(cons cr
291
291
(treepy--context-assoc context
292
- ' :l (cons node l)
293
- ' :r rnext))
292
+ :l (cons node l)
293
+ :r rnext))
294
294
(treepy--meta loc)))))))
295
295
296
296
@@ -302,8 +302,8 @@ If LOC is already the rightmost sibling, return self."
302
302
(treepy--with-meta
303
303
(cons (car (last r))
304
304
(treepy--context-assoc context
305
- ' :l (treepy--join-children l (cons node (butlast r)))
306
- ' :r nil ))
305
+ :l (treepy--join-children l (cons node (butlast r)))
306
+ :r nil ))
307
307
(treepy--meta loc))
308
308
loc)))
309
309
@@ -316,8 +316,8 @@ nil if no more left siblings."
316
316
(treepy--with-meta
317
317
(cons cl
318
318
(treepy--context-assoc context
319
- ' :l lnext
320
- ' :r (cons node r)))
319
+ :l lnext
320
+ :r (cons node r)))
321
321
(treepy--meta loc))))))
322
322
323
323
(defun treepy-leftmost (loc )
@@ -328,8 +328,8 @@ If LOC is already the leftmost sibling, return self."
328
328
(treepy--with-meta
329
329
(cons (car (last l))
330
330
(treepy--context-assoc context
331
- ' :l []
332
- ' :r (treepy--join-children (butlast l) (cons node r))))
331
+ :l []
332
+ :r (treepy--join-children (butlast l) (cons node r))))
333
333
(treepy--meta loc))
334
334
loc)))
335
335
@@ -351,8 +351,8 @@ Return same loc with siblings updated."
351
351
(treepy--with-meta
352
352
(cons node
353
353
(treepy--context-assoc context
354
- ' :l (cons item l)
355
- ' :changed? t ))
354
+ :l (cons item l)
355
+ :changed? t ))
356
356
(treepy--meta loc)))))
357
357
358
358
(defun treepy-insert-right (loc item )
@@ -364,8 +364,8 @@ Return same loc with siblings updated."
364
364
(treepy--with-meta
365
365
(cons node
366
366
(treepy--context-assoc context
367
- ' :r (cons item r)
368
- ' :changed? t ))
367
+ :r (cons item r)
368
+ :changed? t ))
369
369
(treepy--meta loc)))))
370
370
371
371
(defun treepy-replace (loc node )
@@ -374,7 +374,7 @@ Return same loc with siblings updated."
374
374
(treepy--with-meta
375
375
(cons node
376
376
(treepy--context-assoc context
377
- ' :changed? t ))
377
+ :changed? t ))
378
378
(treepy--meta loc))))
379
379
380
380
(defun treepy-edit (loc f &rest args )
@@ -405,8 +405,8 @@ walk."
405
405
(if (> (length l) 0 )
406
406
(let ((nloc (treepy--with-meta (cons (car l)
407
407
(treepy--context-assoc context
408
- ' :l (cdr l)
409
- ' :changed? t ))
408
+ :l (cdr l)
409
+ :changed? t ))
410
410
(treepy--meta loc)))
411
411
(child nil ))
412
412
(while (setq child (and (treepy-branch-p nloc)
@@ -415,7 +415,7 @@ walk."
415
415
nloc)
416
416
(treepy--with-meta
417
417
(cons (treepy-make-node loc (car pnodes) r)
418
- (and ppath (treepy--context-assoc context ' :changed? t )))
418
+ (and ppath (treepy--context-assoc context :changed? t )))
419
419
(treepy--meta loc))))))
420
420
421
421
; ;;; Enumeration
@@ -452,7 +452,7 @@ When reaching the end, returns a distinguished loc detectable via
452
452
" Move to the next LOC in the hierarchy, depth-first.
453
453
Use ORDER if given. Possible values for ORDER are `:preorder' and
454
454
`:postorder' , defaults to the former."
455
- (cl-case (or order ' :preorder )
455
+ (cl-case (or order :preorder )
456
456
(:preorder (treepy--preorder-next loc))
457
457
(:postorder (treepy--postorder-next loc))
458
458
(t (error " Unrecognized order " ))))
@@ -484,7 +484,7 @@ If already at the root, returns nil."
484
484
" Move to the previous LOC in the hierarchy, depth-first.
485
485
Use ORDER if given. Possible values for ORDER are `:preorder' and `:postorder' ,
486
486
defaults to the former."
487
- (cl-case (or order ' :preorder )
487
+ (cl-case (or order :preorder )
488
488
(:preorder (treepy--preorder-prev loc))
489
489
(:postorder (treepy--postorder-prev loc))
490
490
(t (error " Unrecognized order " ))))
0 commit comments