From 2421bd86e7fb1fc54a097cd75bc4a15de788c755 Mon Sep 17 00:00:00 2001 From: Daniel Cerqueira Date: Fri, 5 Sep 2025 13:34:19 +0100 Subject: update README documentation --- README.md | 18 ++++++++++-------- 1 file 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: # 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 -- cgit