-
-
Notifications
You must be signed in to change notification settings - Fork 19
Add tagged-literal support #1101
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks cool! I was not aware of this feature, so thanks for submitting the PR. Looks pretty good to me but I did have a few minor comments.
Does this need to actually be integrated with the reader at some point in time? Right now the reader handles tagged literal forms (which requires each subsequent builtin form to implement logic in the reader, analyzer, and generator 😵 ). I filed #604 years ago and maybe emitting these straight from the reader could simplify the logic of each of those components considerably but I'm not sure how these are used in Clojure.
|
Also I generally like to track PRs with issues as well so I went ahead and filed #1104 which you can add this as the fix PR. |
01418a2 to
801ee73
Compare
|
@chrisrink10 I updated the PR with your suggestions, thanks for the quick feedback, sorry I took a bit to get the changes up. I don't think tagged-literals need to be wired directly into the reader. I opt-in to using them with something like: (require '[clojure.edn :as edn])
(edn/read-string {:default tagged-literal} "#js [1 2 3]")Although, I did notice that my reader conditionals for cljs do cause issues in basilisp: #?(:cljs #js [] :default []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of very minor tweaks and this looks good to me. Thanks again for the PR 🙏
Co-authored-by: Chris Rink <[email protected]>
Co-authored-by: Chris Rink <[email protected]>
Ah, maybe in another ticket we can change the reader to emit |
|
Oh shoot sorry. Could I get you to add a changelog line referencing #1104? |
|
Filed #1118 for the issue you mentioned |
|
Looks like you have some sort of code formatting issue. Not sure about your local dev setup but if you have a Python virtualenv configured you could |
This is a first draft at getting tagged literals working. I don't have much experience with python, so I may have made some amateur mistakes.