summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorDaniel Cerqueira <dan.git@lispclub.com>2025-09-05 13:34:19 +0100
committerDaniel Cerqueira <dan.git@lispclub.com>2025-09-05 13:34:19 +0100
commit2421bd86e7fb1fc54a097cd75bc4a15de788c755 (patch)
tree281b44d91434827b4434f0158b6be1f37b68d732 /README.md
parentb18e1682318452372b0d8017f9ffe72db3e890db (diff)
update README documentation
Diffstat (limited to 'README.md')
-rw-r--r--README.md18
1 files changed, 10 insertions, 8 deletions
diff --git a/README.md b/README.md
index 9989ca8..defeea4 100644
--- a/README.md
+++ b/README.md
@@ -94,18 +94,20 @@ do something at the beginning, because other cons cells should never have `()` i
splitted by each character:
(split 'cons) ; (c o n s)
- (split +123) ; (+ 1 2 3)
+ (split +123) ; (+ (+1 +2 +3))
+ (split +123.4) ; (+ (+1 +2 +3) (+4))
+ (split +01) ; (+ (+0 +1))
(split "meeow") ; ("m" "e" "e" "o" "w")
- (split '(what error)) ; gives an error
- (split cons) ; gives an error
+ (split '(what error)) ; error: (what error) is not a symbol, not a number, not a string
+ (split cons) ; error: #<Primitive cons> is not a symbol, not a number, not a string
-`(join x)` takes a list, returns an symbol from joining each list atom. List atoms
-cannot be of different type:
+`(join x)` takes a list, returns an symbol from joining each list element. The
+joined type depends on the first element of the list:
(join '(a bc d)) ; abcd
- (join '(+0 +1)) ; +0+1
- (join '("a " "string")) ; "a string"
- (join '("what" error)) ; error: cannot join list atoms of different type
+ (join '(- (+0 +1) (+5))) ; -01.5
+ (join '("let's " mix)) ; "let's mix"
+ (join '(what "error")) ; error: (what "error") can only have first-level elements of symbol
### List operations