4 ms·
The tradeoff is that you don't get to have open classes with a module oriented approach. Shameless plug: toyed with the idea of imports and "packages" in Ruby
by lloeki 4y ago
The tradeoff is that you don't get to have open classes with a module oriented approach.
Shameless plug: toyed with the idea of imports and "packages" in Ruby some time ago. Recent facilities in 3.1 (or 3.2?) could make the implementation even easier.
https://github.com/lloeki/pak https://github.com/lloeki/pak
https://github.com/lloeki/ruby-package https://github.com/lloeki/ruby-package
IIRC there's an issue somewhere at bugs.ruby-lang.org about that
EDIT: OMG 8 years ago! /me screams
- dragonwriter 4y ago> The tradeoff is that you don't get to have open classes with a module oriented approach. A module oriented approach could still have open classes, and if you did an imported module could still mess with classes in other imported modules (it would just also have to import them.) In fact, you can set variables in other modules and members (including methods) of other classes this way in Python.
- zem 4y agoi like that! it definitely makes things cleaner in terms of being explicit about where everything comes from.