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

Enum can now be defined with begin block #13

Closed
s-celles opened this issue Aug 10, 2018 · 2 comments
Closed

Enum can now be defined with begin block #13

s-celles opened this issue Aug 10, 2018 · 2 comments

Comments

@s-celles
Copy link
Contributor

Hello,

Since JuliaLang/julia#25424 and so for Julia 0.7 and 1.0, Enum can now be defined with begin block

So (for example)

https://github.com/andrewadare/LibSerialPort.jl/blob/6ac19a8e0497c1051e1ee628e70a3af672f5fcb6/src/wrap.jl#L10-L16

could become

@enum SPReturn begin
    SP_OK = 0
    SP_ERR_ARG = -1
    SP_ERR_FAIL = -2
    SP_ERR_MEM = -3
    SP_ERR_SUPP = -4
end

Kind regards

andrewadare added a commit that referenced this issue Aug 14, 2018
@andrewadare
Copy link
Contributor

Thanks for the tip, this looks a bit cleaner. Updated in 795a6df

@s-celles
Copy link
Contributor Author

Thanks for your library.
I'm currently trying to build a lib using LibSerialPort.jl to communicate with Itead Nextion display.
Nice to see this lib updated.

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

No branches or pull requests

2 participants