Program follows sequence of instructions to arrive at destination I'm warming up with Clojure to try my hand at the advent of code challenge that starts in December. This is my attempt at the first challenge from last year.

This is my first attempt at a non trivial program in clojure, so comments on any part of the program would be appreciated.

(defrecord Vector [x y])

(defrecord State [orientation position])

(def orientations {
    :north (Vector. 0 -1),
    :east (Vector. 1 0),
    :south (Vector. 0 1),
    :west (Vector. -1 0) })

;; Given a compass orientation
;; Return the new orientation after a left turn
(defn turnLeft [current_orientation]
    (case current_orientation
        :north :west
        :east :north
        :south :east
        :west :south))

;; Given a compass orientation
;; Return the new orientation after a right turn
(defn turnRight [current_orientation]
    (case current_orientation
        :north :east
        :east :south
        :south :west
        :west :north))

;; Given a position, orientation and distance
;; Return a new position after moving in that direction for that distance
(defn moveForward [current_position orientation distance]
    (let [direction_vector (orientation orientations)]
        (Vector.
            (+ (:x current_position) (* distance (:x direction_vector)))
            (+ (:y current_position) (* distance (:y direction_vector))))))

;; Given a state and an instruction
;; Return a new state
(defn act [state, instr]
    (case instr
        \L (State. (turnLeft (:orientation state)) (:position state))
        \R (State. (turnRight (:orientation state)) (:position state))
        (State. 
            (:orientation state) 
            (moveForward (:position state) (:orientation state) instr))))

;; Given a starting state and list of instructions
;; Return the final state
(defn doActions [state instrs]
    (if (empty? instrs)
        state
        (doActions (act state (first instrs)) (rest instrs))))

;; Instructions are a sequence of combined instructions as follows:
;; L13, R10, R1, L3, ...
;; Convert this into an alternating list 
;; of TurnLeft / TurnRight and Move instructions
(def instrs
    (-&gt;&gt; "input.txt"
        slurp
        (re-seq #"[LR]|\d+")
        (map
            (fn [instr]
                (case instr
                    "L" \L
                    "R" \R
                    (read-string instr))))))

(require '(java.lang.Math))
(let [finalstate (doActions (State. :north (Vector. 0 0)) instrs)]
    (+ 
        (Math/abs (get-in finalstate [:position :y])) 
        (Math/abs (get-in finalstate [:position :x]))))
Take a look at Bruce Hauman's answer to the question: https://github.com/bhauman/advent-of-clojure-2016/blob/master/src/advent_of_clojure_2016/day1.clj

One thing that was an eye-opener to me is how we all (my answer had :east and :west etc) fall into the trap of having of describing reality rather than just solving the problem with as simple as possible data structures. You can see how little code he had to write - no need for State, no need for functions describing which way was turned. Albeit his advantage was knowing about reductions, which give a path back for every step taken.