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

Set literal execution exception #301

Open nmtitov opened 6 years ago

nmtitov commented 6 years ago

When I execute #{1 2 3} using alt-cmd-B on Mac I get a map exception message. Cursor position doesn't matter for me:

RuntimeException Map literal must contain an even number of forms clojure.lang.Util.runtimeException (Util.java:221)

screen shot 2018-03-31 at 12 06 47 screen shot 2018-03-31 at 12 06 54

kmob commented 6 years ago

Some additional detail to the exception messages resulting from using the dispatch macro (#) in a file.

Running basic set functions with alt-cmd-b at the end of the line of code produces expected outcomes. screen shot 2018-07-02 at 2 17 36 pm

Running set functions written with the dispatch macro and alt-cmd-b produces the following outcomes. screen shot 2018-07-02 at 2 18 16 pm

The REPL shows that the alt-cmd-b seems to be ignoring the "#" and treating the request as a map. screen shot 2018-07-02 at 2 19 06 pm

Running set functions written with the dispatch macro and alt-cmd-s with the code selected produces the following outcomes. The exception error in instances where there are duplicates states that there is an unmatched delimiter. screen shot 2018-07-02 at 2 20 07 pm

The REPL shows that the alt-cmd-s is running the "#" macro with an exception message that matches the issue with the attempted set creation (duplicate keys). screen shot 2018-07-02 at 2 20 33 pm

The alt-cmd-b method for running code from the file also ignores the quote macro character (') when building a list as seen in the following. Using cmd-alt-s with the code selected produces the expected outcome. screen shot 2018-07-02 at 2 34 19 pm

screen shot 2018-07-02 at 2 34 35 pm

nachoba commented 5 years ago

I can confirm and reproduce the same error on a mac.

When doing ctrl+option , then b in:

{1 2 3}

I get: Syntax Error at reading source at (REPL:3:9) Map literal must contain an even number of forms

While entering as: (set '(1 2 3)) returns the correct form #{1 2 3}