Skip to content

rename ENABLE_DEBUG to MRB_DEFINE_HOOKS #3014

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

Closed

Conversation

cremno
Copy link
Contributor

@cremno cremno commented Nov 16, 2015

Here are some reasons why it should be renamed:

  • ENABLE_DEBUG isn't prefixed (possible name clash with other libs)
  • the enable_debug build config method is totally unrelated to this
  • the new name MRB_DEFINE_HOOKS is more precise

ENABLE_DEBUG and DISABLE_DEBUG will still work for backward compatibility but mruby users should update their code. E.g. to #if defined MRB_DEFINE_HOOKS || defined ENABLE_DEBUG.

Here are some reasons why it should be renamed:

- ENABLE_DEBUG isn't prefixed (possible name clash with other libs)
- the enable_debug build config method is totally unrelated to this
- the new name MRB_DEFINE_HOOKS is more precise

ENABLE_DEBUG and DISABLE_DEBUG will still work for backward
compatibility but mruby users should update their code.
E.g. to `#if defined MRB_DEFINE_HOOKS || defined ENABLE_DEBUG`.
@matz
Copy link
Member

matz commented Nov 16, 2015

It's OK to rename it, but I don't think MRB_DEFINE_HOOK is not precise. It sounds like the hook itself, besides that, it doesn't specify which hook we are going to add. How about 'MRB_ENABLE_CODE_FETCH_HOOK`. The only concern is it's too long.

@matz
Copy link
Member

matz commented Nov 16, 2015

And what do you think about another ENABLE_ macro, ENABLE_STDIO?

@zzak
Copy link
Contributor

zzak commented Nov 16, 2015

In any case, I think it should be prefixed with MRB_ to avoid conflicts with other libraries.

@cremno
Copy link
Contributor Author

cremno commented Nov 16, 2015

What about MRB_DEBUG_HOOKS? My only concern is that people might think it's related to MRB_DEBUG.

What do you think about MRB_NO_STDIO or the opposite MRB_USE_STDIO (defined by default)?

@cremno
Copy link
Contributor Author

cremno commented Nov 16, 2015

Or MRB_STATE_DEFINE_HOOKS or just MRB_STATE_HOOKS?

@matz
Copy link
Member

matz commented Nov 16, 2015

I picked MRB_ENABLE_DEBUG_HOOK for consistency with (MRB_)DISABLE_STDIO.

@matz matz closed this in 4440566 Nov 16, 2015
@cremno
Copy link
Contributor Author

cremno commented Nov 16, 2015

Okay. By the way, I've proposed MRB_NO_STDIO because mruby already has MRB_NO_INIT_ARRAY_START.

@zzak
Copy link
Contributor

zzak commented Nov 17, 2015

@matz @cremno The only problem I have with the naming MRB_ENABLE_DEBUG_HOOK is it's similar to MRB_DEBUG. This is probably MRB_DEBUGs fault for being too generic though.

Thoughts?

@matz
Copy link
Member

matz commented Nov 17, 2015

@zzak probably I will rename MRB_DEBUG later, but not this time.

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

Successfully merging this pull request may close these issues.

3 participants