-
Notifications
You must be signed in to change notification settings - Fork 99
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
Having flag attributes is cumbersome with current API #404
Comments
@panglesd i would like to work on this issue |
Yes, sure! Do not hesitate to ask for clarification if something in the issue is obscure! |
@panglesd i have forked and cloned the project . looking at the project, would it be a good idea to make the suggested changes in the src/ast_pattern.ml file? I am still learning and understanding more about the ocaml ecosystem. |
Attributes are part of the OCaml syntax, as in: type t = {
a : int [@foo "an attribute named foo whose payload is a string"]
}
Here, the issue is about adding support for a common case, where the attributes have no payload, the only thing we are interested in is whether they are present or not. For this, I propose to add the |
@panglesd i don't know why i haven't been able to see till i restarted my machine today. At some point i thought you were ignoring me. I was actually caught between the ast_pattern and attrribute model i just wasn't sure which. for now i believe attribute module would be the best way since it's where declaration and retrieval of attributes is done. |
@panglesd since i restarted my machine i am having serious problems. now when i run _dune build _ i get the error
No solution found, exiting |
@pitag-ha i am having some problems. i restarted my machine after almost a week and it must have corrupted everything. now i can't even build or test as shown in the comment above |
Hello @dianaoigo ! The error message when running You could try:
Let me know if that unblocks the situation! |
Also, it is strange that this happened after a machine reboot... Maybe you changed the opam switch, or your environment is not up to date with the switch you have chosen? ( |
I uninstalled everything dune, opam ocaml, reinstalled and updated. somehow that solved the issue. also learnt that any dune version below 2.7 will throw some crazy errors. I have been working on a different ocaml project maybe that was the cause. Could you offer a little more insight on how to proceed? |
@dianaoigo I already gave all the generic information I could in #404 (comment) and #404 (comment), in order to help you more I would need a more detailed question. For instance, I need to know what is clear and what is unclear to you, to answer the right thing. There is a nice blog post about asking good questions here that explains that very well! |
This should be closed by #408 I think. |
Indeed, thanks! |
With current API, one needs to create an "empty payload" pattern:
then register the attribute with a
unit
continuation:And finally, when getting it, turn the
unit option
type into abool
type:All of this could be simplified with the following API addition:
(reported by @sim642 in ocaml-ppx/ppx_deriving#263 (comment))
The text was updated successfully, but these errors were encountered: