Aside from the error that @user100464 points out,
- there is too much global state
- you are mixing computation with reporting.
But first, you call function tickets?, having defined one with the different name of tickets. Let's go for the latter.
In tickets, proms/med-to-high? appears to be global data. I guess from the wording that it applies to some event, which also has some ticket prices attached. We can represent the event data as a map, say
{:prom :low, :prices #{10.50 15.00 25.00}}
Then your tickets function can be
(defn tickets [event price]
(and (#{:medium :high} (:prom event)) ((:prices event) price)))
For instances,
(tickets {:prom :low, :prices #{10.50 15.00 25.00}} 15.0)
;nil
(tickets {:prom :medium, :prices #{10.50 15.00 25.00}} 10.0)
;nil
(tickets {:prom :medium, :prices #{10.50 15.00 25.00}} 15.0)
;15.0
But if I am prepared to spend £20 on a ticket, then one at £10 is fine. So I want to see the range of qualifying prices:
(defn tickets [event price]
(and
(#{:medium :high} (:prom event))
(seq (filter (partial >= price) (:prices event)))))
For instances,
(tickets {:prom :medium, :prices #{10.50 15.00 25.00}} 10.0)
;nil
(tickets {:prom :medium, :prices #{10.50 15.00 25.00}} 20.0)
;(10.5 15.0)
It might be that the prices were a map, giving the number of tickets at each price ... and so on.
The ticket message function can be
(def ticket-message {nil "No tickets at the price"})
Which, applied to nil, yields the message, but applied to anything else, yields nil.