Back
right (clj)
(source)function
(right loc)
Returns the loc of the right sibling of the node at this loc, or nil
Examples
clojure
"(ns autodoc.build-html
\"This is the namespace that builds the HTML pages themselves.
It is implemented with a number of custom enlive templates.\"
{:skip-wiki true, :author \"Tom Faulhaber\"}
(:refer-clojure :exclude [empty complement])
(:import [java.util.jar JarFile]
[java.io File FileWriter BufferedWriter StringReader
BufferedInputStream BufferedOutputStream
ByteArrayOutputStream FileReader FileInputStream]
[java.util.regex Pattern])
(:require [clojure.string :as str])
(:use [net.cgrand.enlive-html :exclude (deftemplate)]
[clojure.java.io :only (as-file file writer)]
[clojure.java.shell :only (sh)]
[clojure.pprint :only (pprint cl-format pprint-ident
pprint-logical-block set-pprint-dispatch
get-pretty-writer fresh-line)]
[clojure.data.json :only (pprint-json)]
[autodoc.collect-info :only (contrib-info)]
[autodoc.params :only (params expand-classpath)])
(:use clojure.set clojure.java.io clojure.data clojure.java.browse
clojure.inspector clojure.zip clojure.stacktrace))")
(defn tst-pprint
"A helper function to pprint to a string with a restricted right margin"
[right-margin obj]
(binding [*print-right-margin* right-margin
*print-pretty* true]
(write obj :stream nil)))
clojure
(ns clojure.test-clojure.clojure-zip
(:use clojure.test)
(:require [clojure.zip :as zip]))
; zipper
;
; seq-zip
; vector-zip
; xml-zip
;
; node
; branch?
; children
; make-node
; path
; lefts
; rights
; down
; up
; root
; right
; rightmost
; left
; leftmost
;
; insert-left
; insert-right
; replace
; edit
; insert-child
; append-child
; next
; prev
; end?
; remove
babashka/babashka
(ns babashka.impl.clojure.zip
{:no-doc true}
(:require [clojure.zip :as zip]
[sci.core :as sci :refer [copy-var]]))
(def zip-namespace
{'zipper (copy-var zip/zipper zip-ns)
'seq-zip (copy-var zip/seq-zip zip-ns)
'vector-zip (copy-var zip/vector-zip zip-ns)
'xml-zip (copy-var zip/xml-zip zip-ns)
'node (copy-var zip/node zip-ns)
'branch? (copy-var zip/branch? zip-ns)
'children (copy-var zip/children zip-ns)
'make-node (copy-var zip/make-node zip-ns)
'path (copy-var zip/path zip-ns)
'lefts (copy-var zip/lefts zip-ns)
'rights (copy-var zip/rights zip-ns)
'down (copy-var zip/down zip-ns)
'up (copy-var zip/up zip-ns)
'root (copy-var zip/root zip-ns)
'right (copy-var zip/right zip-ns)
'rightmost (copy-var zip/rightmost zip-ns)
'left (copy-var zip/left zip-ns)
'leftmost (copy-var zip/leftmost zip-ns)
'insert-left (copy-var zip/insert-left zip-ns)
'insert-right (copy-var zip/insert-right zip-ns)
'replace (copy-var zip/replace zip-ns)
'edit (copy-var zip/edit zip-ns)
'insert-child (copy-var zip/insert-child zip-ns)
'append-child (copy-var zip/append-child zip-ns)
'next (copy-var zip/next zip-ns)
'prev (copy-var zip/prev zip-ns)
'end? (copy-var zip/end? zip-ns)
'remove (copy-var zip/remove zip-ns)})
marick/Midje
(ns midje.parsing.1-to-explicit-form.t-facts
(:require [midje.parsing.1-to-explicit-form.facts :as facts :refer :all]
[midje.sweet :refer :all]
[midje.test-util :refer :all]
[midje.parsing.2-to-lexical-maps.expects :refer [expect]]
[midje.parsing.2-to-lexical-maps.fakes :refer [fake]]
[midje.parsing.2-to-lexical-maps.data-fakes :refer [data-fake]]
[pointer.core :refer [line-number-known]]
[clojure.zip :as zip]
[midje.config :as config]))
(fact "one can add a line number to an arrow sequence"
(let [original `( (f n) => 2 )
expected `( (f n) => 2 :position (line-number-known 10))
z (zip/seq-zip original)
original-loc (-> z zip/down zip/right)
new-loc (#'facts/at-arrow__add-line-number-to-end__no-movement
10 original-loc)]
(name (zip/node new-loc)) => "=>"
(zip/root new-loc) => expected))
BetterThanTomorrow/calva
(ns pez-rewrite-clj.zip
"Client facing facade for zipper functions"
(:refer-clojure :exclude [next find replace remove
seq? map? vector? list? set?
print map get assoc])
(:require [pez-rewrite-clj.zip.base :as base]
[pez-rewrite-clj.parser :as p]
[pez-rewrite-clj.zip.move :as m]
[pez-rewrite-clj.zip.findz :as f]
[pez-rewrite-clj.zip.editz :as ed]
[pez-rewrite-clj.zip.insert :as ins]
[pez-rewrite-clj.zip.removez :as rm]
[pez-rewrite-clj.zip.seqz :as sz]
[clojure.zip :as z]))
;; **********************************
;; Originally in pez-rewrite-clj.zip.move
;; **********************************
(def right
"See [[move/right]]"
m/right)
(def left
"See [[move/left]]"
m/left)
(def down
"See [[move/down]]"
m/down)
(def up
"See [[move/up]]"
m/up)
(def next
"See [[move/next]]"
m/next)
(def end?
"See [[move/end?]]"
m/end?)
(def rightmost?
"See [[move/rightmost?]]"
m/rightmost?)
(def leftmost?
"See [[move/leftmost?]]"
m/leftmost?)
(def prev
"See [[move/prev]]"
m/prev)
(def leftmost
"See [[move/leftmost]]"
m/leftmost)
(def rightmost
"See [[move/rightmost]]"
m/rightmost)
;; **********************************
;; Originally in pez-rewrite-clj.zip.insert
;; **********************************
(def insert-right
"See [[insert/insert-right]]"
ins/insert-right)
(def insert-left
"See [[insert/insert-left]]"
ins/insert-left)
(def insert-child
"See [[insert/insert-child]]"
ins/insert-child)
(def append-child
"See [[insert/append-child]]"
ins/append-child)