diff options
| author | Daniel Cerqueira <dan.git@lispclub.com> | 2026-01-27 17:09:08 +0000 |
|---|---|---|
| committer | Daniel Cerqueira <dan.git@lispclub.com> | 2026-01-27 17:21:29 +0000 |
| commit | 251caf232c6a9a6df65d6c3e1dc036ae6abe353b (patch) | |
| tree | 49e5ead682497788ee2e4f1df4d2aef2b84e8856 /README.md | |
| parent | b8a6feb961d4b9fcc0e652c0374a86b846cb16be (diff) | |
update README documentation
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -304,6 +304,31 @@ variable number of arguments: (+ x +1)) ; #<Lambda (x)> (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 |
