Perl / PPCs

This repository is for Requests For Comments - proposals to change the Perl language.
61 stars 22 forks source link

RFC 0006 - Rename `load` to `load_module` #29

Closed leonerd closed 1 year ago

leonerd commented 1 year ago

Objections were raised at the rather short and inspecific load; suggested that we rename this to load_module.

rwp0 commented 1 year ago

Then we rename use as use_module, and require to require_module (and break everything), not sure why there are objections since it will just make it stand out from the rest of the group.

Grinnz commented 1 year ago

use and require have significant precedent, one might say moreso than any other part of the language. load is a meaningless term to Perl coders. the cases are not at all comparable or related.

leonerd commented 1 year ago

This is about the not-yet-written builtin::load function, which we feel should be called builtin::load_module, to live with the other builtins.

rwp0 commented 1 year ago

Yes, I know. If its fitting for builtin:: to have keywords with harder names, let it be so.

But generally having one-word keywords is better to have in core IMHO matching the other keywords of the language (it was designed with that in mind I believe).

leonerd commented 1 year ago

@rwp0

Yes, I know. If its fitting for builtin:: to have keywords with harder names, let it be so.

Who knows - maybe one day we'll add a builtin::load_json or whatever; at which point having named this load_module rather than simply load would feel like much of an improvement.

cpansprout commented 1 year ago

I just want to mention that we have traditionally reserved underscores for user-defined names; perl core functions don’t use underscores.

Grinnz commented 1 year ago

this isn't a core keyword, it's a function in the builtin namespace

rwp0 commented 1 year ago

Yeah, whatever it's called, naming disputes shouldn't hinder the development. If the default load is too ambiguous, let it be load_module. Btw there's already keywords like export_lexically, so we can live with it 🙂

leonerd commented 1 year ago

@rjbs @book - thoughts?

book commented 1 year ago

I have no issue with the load_module name.

rjbs commented 1 year ago

I think load is better, but really don't care. Like: how about we do the important work of making this work, and then can polish the name as needed.

Merged so that it's not an outstanding question!

rwp0 commented 1 year ago

I then discovered this Perl API C function:

https://perldoc.perl.org/perlapi#load_module

That probably will be a front-end to this one.

Then the name is not so bad I think.