Skip to content
This repository has been archived by the owner on May 10, 2023. It is now read-only.

Set literal execution exception #301

Open
nmtitov opened this issue Mar 31, 2018 · 2 comments
Open

Set literal execution exception #301

nmtitov opened this issue Mar 31, 2018 · 2 comments

Comments

@nmtitov
Copy link

nmtitov commented Mar 31, 2018

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
Copy link

kmob commented Jul 2, 2018

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
Copy link

nachoba commented Apr 28, 2019

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}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants