Accessing any non constant globals from functions is considered impure so if 
you want to overload the "func checker" you can do the following: 
    
    
    var
      x: array[5, int]
    
    x = [1, 2, 3, 4, 5]
    
    # This is fine
    proc access(index: int): auto =
      x[index]
    
    # This gives "'func_access' can have side effects"
    func func_access(index: int): auto =
      {.noSideEffect.}:
        result = x[index]
    
    
    Run

Reply via email to