From 251caf232c6a9a6df65d6c3e1dc036ae6abe353b Mon Sep 17 00:00:00 2001 From: Daniel Cerqueira Date: Tue, 27 Jan 2026 17:09:08 +0000 Subject: update README documentation --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index 3ea66f0..d60153b 100644 --- a/README.md +++ b/README.md @@ -304,6 +304,31 @@ variable number of arguments: (+ x +1)) ; # (plus1 +2) ; +3 +### Other list operations + +`(nth x y)` takes a positive number `x` and a list `y`, returns the element of +list `y` at position `x`: + + (nth +0 '(a b c)) ; a + (nth +9 '(a b c)) ; () + +`(append x y)` returns a list of appending the list `x` to `y`: + + (append '(a b) 'c) ; (a b . c) + (append '(a b) '(c)) ; (a b c) + +`(reverse x)` returns list `x` reversed: + + (reverse '(a b c)) ; (c b a) + +`(map name x)` takes a lambda in `name` and a list `x`, returning a list where +`name` lambda was applied to each element of `x`: + + (map (lambda (x) + (+ x +1)) + '(+0 +1 +2)) ; (+1 +2 +3) + (map atom '(a (b c) d)) ; (t f t) + ### Defining macros `(macro params expr...)` creates an anonymous macro with parameters `params` and -- cgit