to use the features you have to import the relevant modules first, which are mentioned in the titles of the following sections. for example
(use-modules (sph list))
(+ 3 (debug-log (+ 1 2))) (debug-log 1 2 3) -> 1
debug-log returns the first argument and writes all arguments formatted to standard output. intercept the execution flow for tracing without disturbing it
alternative to (lambda () body ...)
(call-with-values (nullary (partition a? b)) list)
let with simplified form that additionally makes binding just one variable a bit shorter
(let (a 1) body ...)
(display-line "test")
(define-syntax-rule (test a b) (+ a b)) (define-syntax-rules test ((test a b) (+ a b)) ((test a) a))
l q qq lambda quote quasiquote
(map (l (a) (+ a 1)) a)
as alternative to
(map (lambda (a) (+ a 1)) a)
(q a) (qq a)
as alternatives to
(quote a) (quasiquote a)
(map-integers 10 (l (n) n))
result
(0 1 2 3 4 5 6 7 8 9)
key and value specified alternatingly
(alist "a" 1 (q b) 2) (ht-create "a" 1 (q b) 2)
in application similar to
(list 1 2 3) (vector 4 5 6)
-q
variants that implicitly quote keys
(alist-q a 1 b 2) (ht-create-symbol-q a 1 b 2)
; hashtable max-depth -> list:alist (ht-alist ht) (ht-alist ht 2) (ht-alist ht (inf))
(alist-ref x (q a)) (ht-ref x (q a))
-q
variants that implicitly quote keys
(alist-ref-q x a) (ht-ref-q x a)
(alists-ref x 1 2 3) (ht-tree-ref x 1 2 3)
(define input (q ("/usr" ("share" "guile") "include" ""))) (prefix-tree->path-list input)
result:
("/usr/share/guile" "/usr/include" "/usr/")
*/**/?
in paths