为什么在以下实例中不会读取行块?
以下是我运行程序时会发生什么。我永远不会输入一个值。
Enter rover's moves LMMRM
Enter rover's moves LMMRM
(defn prompt-for-rover-moves
[]
(do
(println "Enter rover's moves LMMRM ")
(read-line)
))
(defn -main
[& args]
(do
(let [grid-dim-in [0 5]
mr1-pos [\N 2 4]
mr2-pos [\N 1 5]
mr1-movs (prompt-for-rover-moves)
mr2-movs (prompt-for-rover-moves)]
(reset! grid-dim grid-dim-in)
(reset! mr1-id {:mr1 mr1-pos})
(reset! mr2-id {:mr2 mr2-pos})
(.start (Thread. (rover-thread mr1-id mr1-movs)))
(.start (Thread. (rover-thread mr2-id mr2-movs))))))
答案 0 :(得分:1)
将其作为独立的Java应用程序运行,它应该可以正常工作。
我在REPL中遇到了同样的问题,从来没有想出一个像样的解决方案。