Clojure Tutorial - Make a function that can only run once!
on the code again
Hey guys! I’m super amped to have made a video with Peter, the guy who introduced me to Clojure :) He is also the author of a number of Clojure libraries!
This video covers solving a problem using Clojure. The problem here being the need for a function that can only run once.
This video covers problem solving, creating good docstrings, using atoms and checking thread safety.
This video was super exciting to make and I think it turned out really well. The follow up to this video will be launched next week, as the total film time was really long so I think it was better to split the videos up.
Gist: https://gist.github.com/danownsthisspace/f10f85ab51681139255a920f9885c74c
00:00 intro 01:00 setup 01:48 going over idea 02:33 create function to limit 03:42 make function that can only be called once 07:37 atom naming convention 11:06 creating a doc string 13:27 implementing code 13:43 using compare and set 16:00 testing the function 16:33 add arguments to nullary function 18:50 checking thread safety 19:42 end once function ... https://www.youtube.com/watch?v=FK1jV03gjpc
81887422 Bytes