Clojure Passing List Variables
I am trying to pass a list of variables into a function individually however when i try to pass them the function returns nill.
(map (partial shortestPath G) (first Robot)(second Robot))
I tested the bits of code individually and (first Robot) and (second Robot) don't work as i intended them too they currently return and output like so[[:space]].
What i need them to return is just :Space. How would i go about doing this?
(def ItemPickUp [:Space :Mail]) (def ItemDestinations [:Storage :z2]) (def Robot [[ItemPickUp] [ItemDestinations]]) (map (partial shortestPath G) (first Robot)(second Robot))
I managed to solve the problem i needed to use flatten like so
(map (partial shortestPath G) (flatten (first Robot))(flatten(second Robot)))
giving me the desired output
(flatten (first Robot)) (:Mail :d2)