1.

> Is it OK to name procs like new ? As far as I understood it's a "system" word 
> but compiling didn't give me any errors.

new has a couple of overload for ref types. You can use it but you might get 
ambiguous proc warnings if your type happens to be a ref type. Also the 
convention is: initMyType if your type has value semantics and newMyType if 
your type has reference semantics. (newSeq was a mistake from Nim young days).

2\. ref need to be initialized with new
    
    
    proc release(entity: ref ent)=
        add(entStash, entity)
        if not entity.isNil:
          entity.id = 0
        else:
          new entity
    
    
    Run

3\. I think you should define type ent* = ref object if you are passing a 
single instance all around your code. 

Reply via email to