This way:
    
    
    # module myclass
    # this module is Nim's class; even if not really :)
    
    # this is its static method
    proc printSquared*(x: int) = echo x*x
    
    # module test
    # to model classes closer, import nothing from it
    from myclass import nil
    
    var n = 5
    # and now it is
    myclass.printSquared(n) # prints 25
    
    
    Run

Reply via email to