ex_const
ex_const copied to clipboard
enum when using only one entry
Hi,
I have been using ex_cont and find it to be very useful. However, I discovered if I define the following: enum test do only_one_entry 0 end
then a compile error "undefined function only_one_entry/1 (there is no such import)" happens.
My workaround is to change the enum like so:
enum test do only_one_entry 0 unused 0xFFFF end
and never use the second entry.
As an addendum to my previous comments, I found that writing the enum in the form:
enum test, do: [only_one_entry: 0]
works.
As you figured out, the syntax in your last comment is the correct one.