Epoll for D2

bearophile bearophileHUGS at lycos.com
Sat Sep 8 05:49:33 PDT 2012


Adil:

> https://github.com/adilbaig/Epoll-D2

> ev.events = EPOLL_EVENTS.IN | EPOLL_EVENTS.HUP |    
> EPOLL_EVENTS.ERR;

In D enums are kind of (but not really) strongly typed, so 
writing them all in UPPERCASE is often a bad practice. So 
something more similar to this seems nicer:

ev.events = EpollEvents.in | EpollEvents.hupxxxxx | 
EpollEvents.error;


> epoll.add(int file_descriptor, ev);

Is this correct D syntax?

Bye,
bearophile


More information about the Digitalmars-d-announce mailing list