Skip to content

Instantly share code, notes, and snippets.

@cheatfate
Last active May 27, 2016 23:32
s.fds.withValue(fd, value) do:
if (value.flags and FLAG_HANDLE) != 0:
var oe = (value.flags and EVENT_MASK)
if (oe xor event) != 0:
if (oe and EVENT_READ) != 0 and (event and EVENT_READ) == 0:
FD_CLR(fd, s.rSet)
if (oe and EVENT_WRITE) != 0 and (event and EVENT_WRITE) == 0:
FD_CLR(fd, s.wSet)
FD_CLR(fd, s.eSet)
if (oe and EVENT_READ) == 0 and (event and EVENT_READ) != 0:
FD_SET(fd, s.rSet)
if (oe and EVENT_WRITE) == 0 and (event and EVENT_WRITE) != 0:
FD_SET(fd, s.wSet)
FD_SET(fd, s.eSet)
value.flags = FLAG_HANDLE or event
else:
raise newException(ValueError, "error")
do: raise newException(ValueError, "Descriptor is not registered in queue")
@cheatfate
Copy link
Author

cheatfate commented May 27, 2016

If lines 16-17 present nim generates error in line 19:
selectors2.nim(19, 9) Error: invalid indentation
raise newException(ValueError, "Descriptor is not registered in queue")
But if i remove lines 16-17 everything compiling fine...

@cheatfate
Copy link
Author

Newest revision generates this error:

selectors2.nim(1, 12) template/generic instantiation from here
selectors2.nim(18, 7) Error: expression 'raise
  var e: ref ValueError
  new(e)
  e.msg = "Descriptor is not registered in queue"
  e' has no type (or is ambiguous)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment