Clojure - FunFunFunction #5
Key Takeaways
Compares Clojure to JavaScript, highlighting Clojure's minimal syntax
Full Transcript
welcome to fun fun function today we are talking about cloture more specifically the syntax of cloture I am doing this episode a wee bit hungover because yesterday was Halloween I was at a party with a scary tales theme this was my costume it's the three bears from Goldilocks so why is it a good idea to explore other languages we mostly use JavaScript on this show but we don't want to learn JavaScript we want to learn programming and to do that we need to explore and expand our horizons there is a lot of cool things about closure but I want to focus on one little detail today and that is the fact that closure has almost no syntax at all let's compare closure to JavaScript this up here this is valid JavaScript it will evaluate to 6 now here is the same thing in closure when I saw this for the first time it made me go apeshit why it's the fluff on the left this makes no sense this is because what we are looking at is almost the entire closure syntax almost all closure looks like this it's an open parenthesis parenthesis I am NOT a native English speaker and that is a hard word it's an open parenthesis then an operator and then as many operands as you like and then a closing parenthesis what what does it mean I'll show you some more examples and you'll get here is a variable declaration in JavaScript and the same one in closure we initialize the variable my ferret with the value waffles in the closure example we have our operator death most definitely short for a define and then two operands for the variable my ferret and the variable value waffles I'll show you the third example if you look at the JavaScript here we evaluate a boolean expression and then if it is true which it always is in this case we return the first statement at the question mark you can have a delicious soup and then if it's false which is average we return the no soup for you straight in the claw drip code it's the same bloody thing as the other examples it's an open parenthesis the operator is and then followed by three operands the first operand is the boolean being evaluated always true and the second operand is what we get if the boolean is true which it always is and the third operand is what we get if the boolean is false which it never is in this example so in closure it's always operator operand operand operand and close parentheses and the closure that is called a for but where are my curly brackets what if I want to do multiple things in my if statement like this if true is true we should console.log a message and then console of another message well you do it the exact same way so looking at this code you are probably now recognizing closure as that language with all the [ __ ] parentheses but joking aside I mean look at how elegant is this there is no new syntax introduced here the only new thing that we started to do is to nest forms let's go through it together our outer form starts with the operator if after that comes our first operand the boolean being evaluated which is always true and then comes another nested form with the operator - and the operator do will simply well do all of the forms that is passed to it as operands and that is these two print line forms and that's it now you know 90% of the closure syntax and it's pretty cool because most other languages have tons and tons of tons of different language constructs while in closure almost all functionality is enclosed in the operators and the simple form syntax you have watched an episode of fun fun function a weekly show where we tried to come more excited and confident about programming by exploring old wisdom wild ideas and having fun this is a weekly show released on Mondays but not next week because I am having a week off so make sure that you follow me on twitter at MP Jamie so that you don't miss out on that so until next next Monday stay curious
Original Description
💖 Support the show by becoming a Patreon
https://www.patreon.com/funfunfunction
Full transcript here: https://medium.com/@mpjme/8196b274c0f9 Clojure is cool because it has almost no syntax at all. Clojure really is to programming languages what the Star Wars lightsaber is to weapons. Let’s compare Clojure to JavaScript!
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Fun Fun Function · Fun Fun Function · 17 of 60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
▶
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Higher-order functions - Part 1 of Functional Programming in JavaScript
Fun Fun Function
Map - Part 2 of Functional Programming in JavaScript
Fun Fun Function
Reduce basics - Part 3 of Functional Programming in JavaScript
Fun Fun Function
Destructuring: What, Why and How - Part 1 of ES6 JavaScript Features
Fun Fun Function
Reduce Advanced - Part 4 of Functional Programming in JavaScript
Fun Fun Function
Closures - Part 5 of Functional Programming in JavaScript
Fun Fun Function
Too many tools and frameworks!
Fun Fun Function
Currying - Part 6 of Functional Programming in JavaScript
Fun Fun Function
Recursion - Part 7 of Functional Programming in JavaScript
Fun Fun Function
Promises - Part 8 of Functional Programming in JavaScript
Fun Fun Function
Staying relevant as a programmer
Fun Fun Function
Factory Functions in JavaScript
Fun Fun Function
Composition over Inheritance
Fun Fun Function
Software needs to be better - FunFunFunction #1
Fun Fun Function
Unit testing: How to get your team started - FunFunFunction #2
Fun Fun Function
Straight-line code over functions - FunFunFunction #3
Fun Fun Function
Clojure - FunFunFunction #5
Fun Fun Function
The growth stages of a programmer - FunFunFunction #6
Fun Fun Function
5 tips to quickly understand a new code base - FunFunFunction #7
Fun Fun Function
Semicolons cannot save you! - FunFunFunction #9
Fun Fun Function
Functors - FunFunFunction #10
Fun Fun Function
Functors: I was WRONG! - FunFunFunction #11
Fun Fun Function
Questions and Answers - FunFunFunction #12
Fun Fun Function
Streams - FunFunFunction #13
Fun Fun Function
Prototypes in JavaScript - FunFunFunction #16
Fun Fun Function
Fast or Flexible? - FunFunFunction #17
Fun Fun Function
Coders are herd animals - FunFunFunction #18
Fun Fun Function
Weekend Kubernetes Shenanigans - FunFunFunction #19
Fun Fun Function
Monad - FunFunFunction #21
Fun Fun Function
Moar Weekend Shenanigans - FunFunFunction #23
Fun Fun Function
Questions and Answers - FunFunFunction #24
Fun Fun Function
Losing motivation - FunFunFunction #25
Fun Fun Function
LONGEST KUBERNETES SHENANIGANS! - FunFunFunction #26
Fun Fun Function
Fast code is NOT important - FunFunFunction #27
Fun Fun Function
Pair Programming a Facebook Messenger Bot - FunFunFunction #28
Fun Fun Function
Writing unit tests for personal projects? - FunFunFunction #29
Fun Fun Function
Let's Code a Pomodoro Button - FunFunFunction #30
Fun Fun Function
What editor do you use? - FunFunFunction #31
Fun Fun Function
Arrow functions in JavaScript - What, Why and How - FunFunFunction #32
Fun Fun Function
Is Programming Art? - MPJ's Musings - FunFunFunction #33
Fun Fun Function
Generators in JavaScript - What, Why and How - FunFunFunction #34
Fun Fun Function
Haskell Basics - FunFunFunction #35
Fun Fun Function
Haskell - Baby's first functions - FunFunFunction #36
Fun Fun Function
Is Big O relevant to you? - Q&A Part 1 - FunFunFunction #37
Fun Fun Function
How much are you allowed to Google? - Q&A Part 2 - FunFunFunction #38
Fun Fun Function
Haskell lists - FunFunFunction #39
Fun Fun Function
var, let and const - What, why and how - ES6 JavaScript Features
Fun Fun Function
Why are some programming languages popular? - MPJ's Musings - FunFunFunction #41
Fun Fun Function
Does a developer need to be nice? - MPJ's Musings - FunFunFunction #42
Fun Fun Function
bind and this - Object Creation in JavaScript P1 - FunFunFunction #43
Fun Fun Function
Examples of this and bind - Object Creation in JavaScript P2 - FunFunFunction #44
Fun Fun Function
Prototype basics - Object Creation in JavaScript P3 - FunFunFunction #46
Fun Fun Function
Separation of concerns RANT - MPJ's Musings - FunFunFunction #47
Fun Fun Function
Cellular Automata - Pair Programming - FunFunFunction #49
Fun Fun Function
The 'new' keyword - Object Creation in JavaScript P4 - FunFunFunction #50
Fun Fun Function
__proto__ vs prototype - Object Creation in JavaScript P5 - FunFunFunction #52
Fun Fun Function
Unity game pair programming - Let's code - FunFunFunction #53
Fun Fun Function
Throw out your tools - MPJ's Musings - FunFunFunction #54
Fun Fun Function
Unit tests vs. Integration tests - MPJ's Musings - FunFunFunction #55
Fun Fun Function
Object.create - Object Creation in JavaScript P6 - FunFunFunction #57
Fun Fun Function
Related Reads
📰
📰
📰
📰
I Built a 100% Free, Frictionless Resume Builder with Direct PDF/Word Exports
Dev.to · Solangi Waqas
How to Deploy Angular SSR on Cloudflare Workers for Free — No VPS, No Fees, No Credit Card.
Medium · JavaScript
How I Added Browser-Based HEIC to JPG Conversion (No Server, No Upload)
Dev.to · Rushikesh Lade
Angular Signals in 2026: From Fundamentals to Architect-Level Patterns
Dev.to · Amanulla Khan
🎓
Tutor Explanation
DeepCamp AI