1. Re: Enum? A better enum for EUPHORIA
- Posted by Shawn Pringle <shawn.pringle at gmai?.?om> May 15, 2008
- 908 views
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 )"

