jasongilman / proto-repl

A Clojure Development Environment package for the Atom editor
https://atom.io/packages/proto-repl
MIT License
563 stars 50 forks source link

Proto-Repl not properly getting a value from a map with block execution? #253

Closed Linicks closed 7 years ago

Linicks commented 7 years ago

While going through Clojure For The Brave And True, I tried to perform a simple exercise where you get a value from a map. In Proto-Repl, I get the following incorrect answer when trying block execution:

(get {:a 1 :b 2 :c 3} :b) -> {:a 1 :b 2 :c 3}

In a standard Lein-Repl, I get the following correct answer: (get {:a 1 :b 2 :c 3} :b) -> 2

Why am I seeing this odd behavior? Is this a bug?

Thanks! -- Nick

jasongilman commented 7 years ago

The problem is likely due to the location of your cursor when executing a block. If it's inside the map or right next to it it will "execute" the map which just returns the map. You can move your cursor or use the keystroke for the outermost block.

Linicks commented 7 years ago

Awesome, that worked :) Thx!