Skip to content
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

Open
jhass opened this issue Aug 10, 2015 · 9 comments
Open

Metamodel improvement: introduce Module #1150

jhass opened this issue Aug 10, 2015 · 9 comments

Comments

@jhass
Copy link
Member

jhass commented Aug 10, 2015

I think we should further copy the meta model from Ruby, even if it's just fake.

Code Current Expected
Module Undefined constant 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
@technorama
Copy link
Contributor

+1

@sdogruyol
Copy link
Member

This is pretty sweet 👍

@PragTob
Copy link
Contributor

PragTob commented Aug 11, 2015

Looks good to me 👍

@asterite
Copy link
Member

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.

@jhass
Copy link
Member Author

jhass commented Aug 12, 2015

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.

@bjmllr
Copy link
Contributor

bjmllr commented Sep 4, 2015

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

@sardaukar
Copy link

👍

@kuraga
Copy link

kuraga commented Mar 12, 2016

👍

@asterite
Copy link
Member

You can add emojis to the issues themselves, there's no need to add 👍 comments anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants