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

Undocumented: Goby's modules can be new #679

Closed
hachi8833 opened this issue Jun 7, 2018 · 1 comment · Fixed by #681
Closed

Undocumented: Goby's modules can be new #679

hachi8833 opened this issue Jun 7, 2018 · 1 comment · Fixed by #681
Assignees
Labels

Comments

@hachi8833
Copy link
Member

Actually, I found the undocumented behavior some months ago, and the st0012 and I left this as is by now.

Goby's modules can be instantiated:

#Goby
module Foo
end

Foo.new       # modules can be instantiated in Goby
#» <Instance of: Foo>

# of course inheritance of modules is prohibited
class Bar < Foo
end
#» InternalError: Module inheritance is not supported: Foo

Of course this is prohibited in Ruby.
But I think the behavior suggests using modules more frequent rather than inheritance so I prefer to it.

Just close the issue if this is OK > @st0012
If not, let get started a discussion.

@st0012
Copy link
Member

st0012 commented Jun 9, 2018

I think this should be prohibited because it'll be very confusing for the users who read the code later, and this violate Goby's "explicit" principle.

@st0012 st0012 self-assigned this Jun 9, 2018
@ghost ghost added the in progress label Jun 9, 2018
@st0012 st0012 added bug and removed Needs feedback labels Jun 9, 2018
@st0012 st0012 added this to the version 0.1.10 milestone Jun 9, 2018
@ghost ghost removed the in progress label Jun 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants