pxeger / whython

Fork of Python with some terrible custom features hacked in
https://www.pxeger.com/2021-09-19-hacking-on-cpython/
Other
16 stars 3 forks source link

Add UFCS #9

Open cgccuser opened 2 years ago

cgccuser commented 2 years ago

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.