Similarly, we organise dates hierarchically with specific orders of magnitude such as years, months, days, hours, minutes, and seconds. For example, the date December 19, 2011 can be represented as 2011.12.19. As these version numbers are just paths in a hierarchy, we can easily represent them in Lisp:
(date. 1957 6 12)
(date. 2008 9 3)
These paths are also similar to file system paths, which allows you to easily organise your files according to date. In Clojure, you can access the value of a data structure at a path using get-in.
No comments:
Post a Comment