-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
[1.0.0] Set cannot be called as inner value of Data Structures (macro edn!) #4
Comments
What is the use case for the Doing it like this has a lot of limitations, like this issue. This seems like an almost impossible (or at least an endless) task or it quickly reinventing all of I finally got around to learning about proc_macros this weekend. I made a proof of concept. This is not done yet. I wanted opinions before going through and doing the rest, testing it, etc. This needs to be a separate crate because it's a You can see the minimal example, with this issue's original EDN here Eventually rust's const will be as powerful as c++'s constexpr, which should actually allow this crate's @naomijub Any thoughts on just removing the macro entirely from this crate and having a macro crate until parse can be const? |
I made it match the current usage a bit more. I also managed to make it dependency-free. If we go this route, I'll go for 100% coverage and move over all existing tests. It seems to work with all the insanity you would expect from valid EDN A side note, doing it this way actually gives some nice compiler warnings. For example, using my "parse" branch
|
Depending on what we do with #148 we can actually capture with a proc_macro so it should be possible to do something like let num = some_calc();
return edn!({:ok "ok" :num #capt num}); or maybe there's some other symbols we can use, like |
NO FURTHER DEVELOPMENT PLANNED |
The macro
edn!
fails when we try to call aSet
inside any other structure.Gets an error of
expected
[, found end of macro arguments
. Same is valid for set in set,#{ 1 2 3 #{4 5 6}}
.The text was updated successfully, but these errors were encountered: