Nim has this really cool thing called UFCS that works something like this: foo(bar, baz) = bar.foo(baz) and foo.bar = bar(foo). I propose that if you can't find a function foo to call on bar, you look for a method called foo inside bar, and vice versa.
Nim has this really cool thing called UFCS that works something like this:
foo(bar, baz) = bar.foo(baz)
andfoo.bar = bar(foo)
. I propose that if you can't find a functionfoo
to call onbar
, you look for a method calledfoo
insidebar
, and vice versa.