lsp-cli 0.1.6

Command-line tool for talking to Language Server Protocol (LSP) servers from the terminal.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
(ns main)

(defrecord OrderItem [name quantity price])

(defrecord Order [customer items])

(defn order-total [order]
  (reduce + (map (fn [item] (* (:quantity item) (:price item))) (:items order))))

(defn build-sample-order []
  (->Order "Carol" [(->OrderItem "Mouse" 1 35.0) (->OrderItem "Pad" 1 12.5)]))

(defn format-order [order]
  (str (:customer order) " has " (count (:items order)) " items worth " (order-total order)))

(println (format-order (build-sample-order)))