Hi everyone,
I am wondering if it is possible to define a procedure on a type itself ? Coming from the Python world, it would be called a class method or a static method.
I really like to use this kind of syntax to create objects, and in Nim I imagine it could work like:
type
User = object
name: string
proc create_admin(user_type: Type[User]): User =
return User(name: "admin")
let dobby = User.create_admin()