New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metamodel improvement: introduce Module #1150
Comments
+1 |
This is pretty sweet 👍 |
Looks good to me 👍 |
We'll probably do this with time, although I always wonder what's the use for a metamodel, and specially the need to distinguish between a module and a class at runtime. |
It's mostly introspection. Sometimes it's just quicker to do p Something.class than consulting documentation. The other point is consistency, there's a certain beauty to the root of the type system following the same rules than your own stuff. |
Should Crystal's Module have comparison operators (< <= <=> > >=) like those provided in Ruby's Module to query the variance between two modules? Also related to #1297 |
👍 |
👍 |
You can add emojis to the issues themselves, there's no need to add 👍 comments anymore |
I think we should further copy the meta model from Ruby, even if it's just fake.
Module
Module
Module.class
Class
Module.is_a? Object
true
class C; end; C.is_a? Module
true
module M; end; M.is_a? Module
true
class C; end; C.is_a? Class
true
true
module M; end; M.is_a? Class
true
false
module M; end; M.class
Class
Module
module M; end; M.class.class
Class
Class
The text was updated successfully, but these errors were encountered: