As far as I understand the `include` statement includes the **content of the 
file**.

But the example below doesn't work that way, there's the difference if the 
content of the `base.nim` \- typed manually (script works) or included via 
`include` statement (doesn't work).

Why?

[playground](https://wandbox.org/permlink/4CMzxcVWlunjPh1c)
    
    
    # main.nim
    
    # include base
    import system except find
    import mylib, sugar, options
    
    echo @[1, 2, 3].find((v) => v == 2).get
    
    # base.nim
    
    import system except find
    import mylib, sugar, options
    
    # mylib.nim
    
    import system except find
    import options, sugar
    
    func find*[T](list: openarray[T], check: (T) -> bool): Option[T] =
      for v in list:
        if check(v): return v.some
      T.none
    
    
    
    Run

Reply via email to