Skip to content

Commit 1a8a044

Browse files
committed
Improve formatting in Rust macro article
1 parent ae30b23 commit 1a8a044

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

org/_posts/2024-09-13-rust_simple_declarative_macros.org

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,15 +198,15 @@ Pretty neat! Even if it uses =if= under the hood, we have now extended the langu
198198

199199

200200
Like we discussed above, we need parentheses around the =cond= variable for it to work. What happens if we remove them? First of all, the compiler won't know where our expression ends! Let's see what it says:
201-
#+BEGIN_VERSE
201+
#+BEGIN_SRC text
202202
error: `$cond:expr` is followed by `$r#do:block`, which is not allowed for `expr` fragments
203203
--> src/main.rs:2:17
204204
|
205205
2 | ($cond:expr $do:block) => {
206206
| ^^^^^^^^^ not allowed after `expr` fragments
207207
|
208208
= note: allowed there are: `=>`, `,` or `;`
209-
#+END_VERSE
209+
#+END_SRC
210210

211211

212212
*What about arbitrary amount of inputs?*
@@ -430,7 +430,8 @@ This will vary a bit on who you ask. Some people, especially those who are not f
430430
I originally fell in love with the concept of macros when I first started learning about Lisp (which is about 15 years ago). (the dialect was Scheme/Racket in the beginning, but went on to Common Lisp). In the beginning, they felt alien to me. Like much of the "black magic" in Lisp, I was instantly smitten. They were so expressive and powerful! You could make code that was almost incomprehensible to other people, but that did things they only could dream of. I did not care what others were thinking, I wanted it MY way. While my social skills at the time was awful, I like to think I have gotten slightly better... I think a quote from Robert C. Martin in The Clean Coder describes me and others perfectly:
431431

432432
#+BEGIN_QUOTE
433-
"You see, programmers tend to be arrogant, self-absorbed introverts. We didn’t get into this business because we like people. Most of us got into programming because we prefer to deeply focus on sterile minutia, juggle lots of concepts simultaneously, and in general prove to ourselves that we have brains the size of a planet, all while not having to interact with the messy complexities of other people." (Robert C. Martin, The Clean Coder)
433+
"You see, programmers tend to be arrogant, self-absorbed introverts. We didn’t get into this business because we like people. Most of us got into programming because we prefer to deeply focus on sterile minutia, juggle lots of concepts simultaneously, and in general prove to ourselves that we have brains the size of a planet, all while not having to interact with the messy complexities of other people."
434+
- (Robert C. Martin, The Clean Coder)
434435
#+END_QUOTE
435436

436437

0 commit comments

Comments
 (0)