Skip to content

Instantly share code, notes, and snippets.

@tgk
Created June 26, 2020 08:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tgk/099c6e1708f57e165fa139e730a89295 to your computer and use it in GitHub Desktop.
Save tgk/099c6e1708f57e165fa139e730a89295 to your computer and use it in GitHub Desktop.
Alternative to load-object
;; alternative strategy for navigating maps
(def rental-ad {:id 42, :car_id 56, :name_and_model "Peugeot 208"})
(follow rental-ad :name_and_model)
;; => "Peugeot 208"
(follow rental-ad :car)
;; => {:user_id 3, :car_type_id 5}
(follow rental-ad :car :user :name)
;; => "Thomas"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment