Things I Like About Nim
Method Call Syntax In Nim, a.f(b) is really just syntactic sugar for f(a, b). Note: they look like methods but aren’t attached to the type/object at all. Which function to call will be figured out at compile time, just like normal function calls.
You can use this to implement pseudo extension methods on standard types like strings:
import nim_utils/files, os, strformat proc makeBackup(filename: string) = let backupPath = fmt"{filename}.bak" case filename.
[Read More]