3 ms·
But set! doesn't take three arguments either. I mean, it's fine if you're just trying to show syntax, but if you say some code is Racket code, it should be able
by zck 11y ago
But set! doesn't take three arguments either. I mean, it's fine if you're just trying to show syntax, but if you say some code is Racket code, it should be able to be pasted into a Racket repl. If you're using real code, you should leverage our current understanding: "oh, we're setting a variable here, so I expect it to work this way", and not confuse us: "why are we dividing strings?" Otherwise, you should just use the function `foo`, and call it with arguments `bar`, `(baz bif)`, and `, 3`.
I think the comma operator is horribly explained, and I don't currently understand it. It "turns the expression it belongs into several words(or expressions)." Apparently (, 3) is the same as 3. Is it the same as identity, because each new line is a function call? But the identity function doesn't return several values (what are "words" in this context?), but only one.
Also also, the section beginning "However, Cirru does contain tricky parts in representing strings in Cirru", beyond being awkwardly worded, is confusing too. The only explanation is it "behaves like a Bash", and says two expressions "are totally different". What behaving like Bash does is never explained, and because you show inputs but no outputs, I can't tell how it differs.
Your example of, I think, escaping double quotes in a string is compared to a print of these five variables. When you say the two prints are "totally different", is it because one print expression is called with three strings, and the other with five variables? Do you expect that to be a point of confusion for the reader? It seems as though the two print statements are totally unrelated, but by joining them with "these are totally different", it makes the reader try to see where the confusion would be. And I'm confused why anyone who's familiar with programming enough to read this introduction would think they're the same.
You say that "Quotes are required when a token contains whitespace", but what token contains whitespace? You seem to rely on unset variables (the second `print` has variables `data`, `a`, `b`, `c`, and `d`, which are defined nowhere).
- jiyinyiyong 11y agoYou are right. I should give better examples. For comma syntax I updated to this: + a + 1 2 , 3 4 5 ;; which is also (+ a (+ 1 2) (, 3 4 5)) ;; and (+ a (+ 1 2) 3 4 5)
- jiyinyiyong 11y agoAlso updated the descriptions on double quotes, the only purpose of quotes is escaping.