charly-lang / charly

🐈 The Charly Programming Language | Written by @KCreate
https://charly-lang.github.io/charly/
MIT License
199 stars 10 forks source link

Make Object#pretty_print a static method on Object #130

Closed KCreate closed 7 years ago

KCreate commented 7 years ago

That way we don't get any conflicts when pretty_printing an object that already has a method called pretty_print.

The following will return an invalid result, as the Numeric.method object already contains a method called pretty_print.

Numeric.methods.pretty_print()

The following syntax would fix that:

Object.pretty_print(Numeric.methods)