18:41:21man213Hi folks. I need a help with sbcl alien enums. I have an enum type, defined with (define-alien-type ... (enum ... (...)...)). Could someone point me out how I can convert an enum value to integer it represents? Simple casting via (cast val type) does not help. Thanks.
19:48:29Krystofman213: I don't really recommend this, but: if foo is your enum type and :baz is one of the values, try
19:50:16Krystofin an ideal world, you don't need the integer representation on the lisp side at all
19:50:30Krystofif your world is not ideal, there are a number of things you can do to cope
19:51:09Krystofif foo is your enum and :baz your value, you could do (position :baz (sb-kernel:member-type-members (sb-kernel:specifier-type '(alien foo))))