Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tagged literal where literal is a set or some other forms #97

Closed
sogaiu opened this issue Oct 23, 2020 · 1 comment · Fixed by #98
Closed

Tagged literal where literal is a set or some other forms #97

sogaiu opened this issue Oct 23, 2020 · 1 comment · Fixed by #98
Labels
bug Something isn't working

Comments

@sogaiu
Copy link

sogaiu commented Oct 23, 2020

With master (83cd988) and fix-names (72abf7e) for a map in a tagged literal, I get:

parcera.core=> (ast "#mytag {}")
(:code 
  (:tag
    (:symbol "mytag") (:whitespace " ") 
    (:map)))

That looks good.

However, for a set, I get:

parcera.core=> (ast "#mytag #{}")
(:code 
  (:tag 
    (:symbol "mytag") (:whitespace " ")) 
  (:set))

I may be mistaken, but IIUC, one aspect of tagged literals is that one can arrange to have a function operate upon whatever was tagged to produce an arbitrary value.

On the "Reader" page at clojure.org, there is this text:

...parse the form following the tag.

via: https://clojure.org/reference/reader#tagged_literals

It's not clear to me if there are any restrictions as to what the form can be. I had assumed that pretty much anything can be made to work.

@carocad carocad added the bug Something isn't working label Oct 23, 2020
@carocad
Copy link
Owner

carocad commented Oct 23, 2020

mmmmm I am not sure exactly why I did it that way to be honest. I might have confused the rules for ctor reader with those of tag reader 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants