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

Clean API functions names #25

Open
aaptel opened this issue Nov 1, 2015 · 11 comments
Open

Clean API functions names #25

aaptel opened this issue Nov 1, 2015 · 11 comments

Comments

@aaptel
Copy link
Owner

aaptel commented Nov 1, 2015

Chose and keep a consistent style for API function name. Let's do this while we can (ie before release).

@phst
Copy link
Collaborator

phst commented Nov 9, 2015

I'd suggest to stay as close as possible to definitions in the Emacs Lisp manual and the naming of Emacs functions.

@aaptel
Copy link
Owner Author

aaptel commented Nov 9, 2015

Instead of "error" we should say "nonlocal exit"

Ok, so nonlocal_exit?

Instead of "fixnum" we should say "integer"

Ok.

Instead of using different names for C and Lisp types, let's just say {make,extract}_{integer,float} or so

I don't like using float for double but I agree it's more consistent. What do you think of using get instead of extract?

@aaptel
Copy link
Owner Author

aaptel commented Nov 9, 2015

Maybe we can find a better name for the "user ptr" thingy? "Module reference"?

What is wrong with "user ptr"?

@phst phst modified the milestone: GNU Emacs 25.1 Nov 10, 2015
@phst
Copy link
Collaborator

phst commented Nov 10, 2015

What is wrong with "user ptr"?

Nothing in particular, I'm just not overly fond of function names like get_user_ptr_ptr. It seems like a "user pointer" is an object containing a pointer and a finalizer, so it shouldn't itself be called "pointer."

@aaptel
Copy link
Owner Author

aaptel commented Nov 11, 2015

get_module_ref_ptr doesnt look that prettier. Maybe we could just use get_user_ptr and get_user_finalizer.

@tromey
Copy link
Collaborator

tromey commented Nov 11, 2015

It still seems better to extend Lisp_Save_Value to take an optional finalizer and avoid adding a second opaque pointer type to Emacs. You can just make it possible for the first slot to be a finalizer, there are still SAVE_* bits left.

@phst
Copy link
Collaborator

phst commented Nov 11, 2015

That would also work, but I think it wouldn't change the interface or naming. (There is currently no way to create Save_Values from modules.)

@aaptel
Copy link
Owner Author

aaptel commented Nov 13, 2015

I think user pointer are fundamentally different than Save_Values and as such deserve a type. We might need extra fields in the future that save values cannot accomodate for.

@aaptel
Copy link
Owner Author

aaptel commented Nov 13, 2015

I've pushed a commit that updated API functions & other denominations according to this discussion. I'm keeping this open in case we still want to change some names. If you are OK with this please say so, so I can close the issue.

@tromey you probably need to update your ffi module.

@tromey
Copy link
Collaborator

tromey commented Nov 14, 2015

I don't want to keep bugging you about the type thing, so I promise I won't bring it up again. But anyway my view is that types are important for user code (or I suppose the platform) to differentiate between different kinds of objects. But, in this case, both user-pointers and save-values are just opaque types that are essentially useless to elisp. That is why, in my view, it makes sense to unify them.

@aaptel
Copy link
Owner Author

aaptel commented Nov 14, 2015

Save_Value is an internal type that is not supposed to be exposed to users.

User-pointer are can be exposed. We could add a symbol or some kind of id as user-ptr sub-types (like we had previously with module_id...).

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

No branches or pull requests

3 participants