Re: Enum? A better enum for EUPHORIA

new topic     » topic index » view thread      » older message » newer message

Instead of enum as it is from C.  We can vastly improve on 
enum.  Consider labeling a group of constants in an enum statement

enum memory_protection MEM_WRITEREAD = #40, MEM_READ = #80, ...


puts(1, memory_protection.to_string( #40 )) -- displays "MEM_WRITEREAD"


enum bitfield linux_memory_protection PROT_NONE = 0, 
PROT_READ = 1, 
PROT_WRITE = 2, PROT_EXEC = 4

puts( 1, linux_memory_protection.to_string( 3 ) ) -- displays "or_bits(
PROT_READ, PROT_WRITE )"

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu