There are times I need to pass a seq as a pointer and byte-count, usually to C 
code but sometimes to Nim code like AsyncSocket.send.

If I do it like this: 
    
    
    socket.send(addr data[0], data.len)
    
    
    Run

it unfortunately raises a RangeError when `data` is empty. So I have to 
complicate my code with an `if` test.

**Is there a way to get the address of a seq 's items, that doesn't have this 
problem?** (`addr data` doesn't work because it gives the address of the seq 
itself, which starts with a length field not the data.) 

Reply via email to