Code: Select all
(setq a '(1 (2 (3 4)) (5 6)))
;Indexes
(ref-all nil a (fn (x) true))
((0) (1) (1 0) (1 1) (1 1 0) (1 1 1) (2) (2 0) (2 1))
;Elements
(ref-all nil a (fn (x) true) true)
(1 (2 (3 4)) 2 (3 4) 3 4 (5 6) 5 6)
Code: Select all
(setq a '(1 (2 (3 4)) (5 6)))
;Indexes
(ref-all nil a (fn (x) true))
((0) (1) (1 0) (1 1) (1 1 0) (1 1 1) (2) (2 0) (2 1))
;Elements
(ref-all nil a (fn (x) true) true)
(1 (2 (3 4)) 2 (3 4) 3 4 (5 6) 5 6)
Code: Select all
(new Tree 'hh)
(for (i 1 5)
(setq key (string i))
(for (k i 1 -1)
(hh key (if DOLLAR-it (extend (list k) DOLLAR-it) (list k)))
)
)
(hh)
Code: Select all
output: (("1" (1)) ("2" (1 2)) ("3" (1 2 3)) ("4" (1 2 3 4)) ("5" (1 2 3 4 5)))
Code: Select all
((("e" 9) ("f" 7) ("i" 6) ("l" 2) ("n" 1) ("p" 0) ("s" 4) ("u" 5) ("w" 8))
(("e" 8) ("f" 2) ("i" 3) ("l" 7) ("n" 1) ("p" 0) ("s" 6) ("u" 5) ("w" 4))
(("e" 9) ("f" 2) ("i" 8) ("l" 7) ("n" 1) ("p" 0) ("s" 4) ("u" 5) ("w" 6)))
Code: Select all
LISP *
FUN =
---------
NEWLISP
Code: Select all
(define (hash? hash)
(and (context? (evals hash))
(not (list? (evals (sym (term hash) hash nil))))))
Code: Select all
> (push x x)
(?)
> (x 0 0)
ERR: list reference changed
x