9. Host Platform Interoperability with Java and JavaScript
Activity 9.01: Book-Ordering Application
Solution:
- Create a new project:
lein new app books-app
- Import the necessary namespaces:
(ns books-app.core (:require [books-app.utils :as utils]) (:import [java.util Scanner]) (:gen-class))
- Create a map to hold books by year:
(def ^:const books {:2019 {:clojure {:title "Hands-On Reactive Programming with Clojure" :price 20} :go {:title "Go Cookbook" :price 18}} :2018 {:clojure {:title "Clojure Microservices" :price 15} ...