I copy-pasted the stuff you posted, fixed wrong types in several places, and 
the documentation seems ok:
    
    
    proc median*(A: var openArray[int], left, right: Natural,
                 myCmp: proc(x, y: int): int {.nimcall} = cmp[int]): float =
      result = 1.0
    
    runnableExamples:
      static:
        block:
          func FCmp(x, y: int): int =
            if x==y: 0 elif x<y: -1 else: 1
          
          var
            F = [7,4,6,3,9,1]   #  sorted  1 3 4 6 7 9
            FSv= F
          
          doAssert median(F,0,5,FCmp) == 1.0
    
    
    Run

Reply via email to