From 5ab4fb659a34e46873c7734e8d0ce0f6c6c860e5 Mon Sep 17 00:00:00 2001 From: Sergei Date: Sat, 1 Apr 2017 23:00:08 +0700 Subject: Update clojure-macros.html.markdown (#2694) --- clojure-macros.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clojure-macros.html.markdown') diff --git a/clojure-macros.html.markdown b/clojure-macros.html.markdown index d74f77cf..89066faf 100644 --- a/clojure-macros.html.markdown +++ b/clojure-macros.html.markdown @@ -99,13 +99,13 @@ You'll want to be familiar with Clojure. Make sure you understand everything in (list x) ; -> (4) ;; You can use # within ` to produce a gensym for each symbol automatically -(defmacro define-x-hygenically [] +(defmacro define-x-hygienically [] `(do (def x# 2) (list x#))) (def x 4) -(define-x-hygenically) ; -> (2) +(define-x-hygienically) ; -> (2) (list x) ; -> (4) ;; It's typical to use helper functions with macros. Let's create a few to -- cgit v1.2.3 From 1ca9a0911060d46609aa2b715002607fae3cc272 Mon Sep 17 00:00:00 2001 From: attil-io Date: Wed, 11 Oct 2017 19:49:55 +0200 Subject: Fix typo Remove unnecessary closing parenthesis from inline-2 macro. --- clojure-macros.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clojure-macros.html.markdown') diff --git a/clojure-macros.html.markdown b/clojure-macros.html.markdown index 89066faf..3864f676 100644 --- a/clojure-macros.html.markdown +++ b/clojure-macros.html.markdown @@ -131,7 +131,7 @@ You'll want to be familiar with Clojure. Make sure you understand everything in ; However, we'll need to make it a macro if we want it to be run at compile time (defmacro inline-2 [form] - (inline-2-helper form))) + (inline-2-helper form)) (macroexpand '(inline-2 (1 + (3 / 2) - (1 / 2) + 1))) ; -> (+ (- (+ 1 (/ 3 2)) (/ 1 2)) 1) -- cgit v1.2.3 From 933d4c4057ea3d0eeaa06c08fd866cdc8b2c0ed7 Mon Sep 17 00:00:00 2001 From: Felipe N Souza Date: Tue, 30 Oct 2018 22:14:17 -0300 Subject: [clojure-macros] Fixed links (#3351) * [clojure-macros] Fixed links * [clojure-macros] Fixed link --- clojure-macros.html.markdown | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'clojure-macros.html.markdown') diff --git a/clojure-macros.html.markdown b/clojure-macros.html.markdown index 3864f676..6154d570 100644 --- a/clojure-macros.html.markdown +++ b/clojure-macros.html.markdown @@ -142,11 +142,8 @@ You'll want to be familiar with Clojure. Make sure you understand everything in ### Further Reading -Writing Macros from [Clojure for the Brave and True](http://www.braveclojure.com/) -[http://www.braveclojure.com/writing-macros/](http://www.braveclojure.com/writing-macros/) +[Writing Macros](http://www.braveclojure.com/writing-macros/) -Official docs -[http://clojure.org/macros](http://clojure.org/macros) +[Official docs](http://clojure.org/macros) -When to use macros? -[http://dunsmor.com/lisp/onlisp/onlisp_12.html](http://dunsmor.com/lisp/onlisp/onlisp_12.html) +[When to use macros?](https://lispcast.com/when-to-use-a-macro/) -- cgit v1.2.3