Recommended Learning Exercise : Simulating A Parking Garage in Clojure

Here is a nice example of creating software that simulates a parking garage. Two different examples. If you are learning Clojure this might be of interest to you.  In the first example, Clojure Refs are used. The problem is to simulate operations on a garage used for parking vehicles – vehicles come into the parking garage, park and then later leave.  They are identified by their license plate number.  This is a nice example for those looking for Clojure examples.

parkgarage1

In the second example, the same parking garage problem from the previous post is solved using  clojure.spec . See more on the clojure.spec rationale and the  guide.  Here is the second example which uses Clojure.spec.

garagespec2