You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Related to this thread. When I learned of ei I tried my hand at implementing a wrapper in my go-to Scheme implementation, and noticed that ei_get_type() returns the ei version number for a full encoded Erlang term. However, because the version is not defined in ei.h, I have to guess that that is the version and not an unknown type.
If this is totally intentional and there's a reason for the version not to be publicly defined (maybe I'm holding it wrong?), I would also like to know -- maybe the docs are lacking in some way in that case.
Describe alternatives you've considered
As a temporary workaround, I've defined the version number in the wrapper library. This is not ideal, in case the version changes, although it's also not worrying since the last change was ~15 years ago ^^
The text was updated successfully, but these errors were encountered:
I suspect that you're using it wrong, the first part of an encoded term is a version that must be decoded with ei_decode_version first.
That ei_get_type returns the first encountered byte is a bit of an accident, I think it should signal failure (-1) instead when encountering a type it does not recognize.
I wouldn't be surprised, and as long as I learn how to use it correctly, I don't mind. So my thought process previously was to ei_get_type() and then call the corresponding ei_decode_*(). You're saying one should instead call ei_decode_version() before any other ei_get_type()/ei_decode_*(). Is that the intended usage of the library?
Is your feature request related to a problem? Please describe.
Related to this thread. When I learned of
ei
I tried my hand at implementing a wrapper in my go-to Scheme implementation, and noticed thatei_get_type()
returns theei
version number for a full encoded Erlang term. However, because the version is not defined inei.h
, I have to guess that that is the version and not an unknown type.Describe the solution you'd like
It appears to me that
ERL_VERSION_MAGIC
could be moved to somewhere around here.If this is totally intentional and there's a reason for the version not to be publicly defined (maybe I'm holding it wrong?), I would also like to know -- maybe the docs are lacking in some way in that case.
Describe alternatives you've considered
As a temporary workaround, I've defined the version number in the wrapper library. This is not ideal, in case the version changes, although it's also not worrying since the last change was ~15 years ago ^^
The text was updated successfully, but these errors were encountered: