diff options
| author | Daniel Cerqueira <dan.git@lispclub.com> | 2025-09-05 13:34:19 +0100 |
|---|---|---|
| committer | Daniel Cerqueira <dan.git@lispclub.com> | 2025-09-05 13:34:19 +0100 |
| commit | 2421bd86e7fb1fc54a097cd75bc4a15de788c755 (patch) | |
| tree | 281b44d91434827b4434f0158b6be1f37b68d732 | |
| parent | b18e1682318452372b0d8017f9ffe72db3e890db (diff) | |
update README documentation
| -rw-r--r-- | README.md | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -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 |
