-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Changed label name for string functions to sub. #9820
Conversation
I apologise for coming armed with a paint can, but "sub" is an English abbreviation for "substitute" which makes these functions read very strangely to me (I grant that it's consistent with Can I offer either |
Or for submissive, subliminal, subscriber, submarine (sandwich), subwoofer, subtitle, or subutex, according to the Urban Dictionary...
Indeed, I think "sub" was intended to connote "substring", not "substitution".
I've never seen "affix" used in ordinary speech, in programming, nor in computer science textbooks. The original code with "prefix" and "suffix" is fine. Let's not make it worse. |
My point is it reads oddly to use a word meaning substitute (I'll see your Urban dictionary and raise you the OED...) as an abbreviation for a different word... although at least we've never come close to the JavaScript meaning of
Erm, for what it's worth - I learned it in computer science, possibly, according to Google, in exactly these slides: https://www.cl.cam.ac.uk/teaching/2004/NatLangProc/slides2.pdf
I agree - although there was a higher order argument for using the same label name. |
I have used Now I think one day we want do want to have The notion of |
(I would gladly link on the |
As @dra27 wrote,
To me |
I wouldn't have thought the latin In any case you won't find these things unprefixed or as single tokens, in context this is But if we really need not to hurt anyone's interpretation and/or trigger perverted minds, I'm fine with using String.includes : substr:string -> string -> bool
String.starts_with : substr:string -> string -> bool
String.ends_with : substr:string -> string -> bool
String.find_substr : ?start:int -> substr:string -> string -> int option
String.sub : string -> int -> int -> string (* that one we can't change *) For reference that's what a simple String.includes : sub:string -> string -> bool
String.starts_with : sub:string -> string -> bool
String.ends_with : sub:string -> string -> bool
String.find_sub : ?start:int -> sub:string -> string -> int option
String.sub : int -> int -> string -> string |
I changed the label from |
I still think |
Also a native english speaker actually did propose to use |
As in the original PR it seems that there is no conclusion what a good name would be, so I close this PR. |
I would also be in favor of |
As mentioned by @dbuenzli in #9533 (comment) using
sub
as label might be a better idea since it is uniform across all functions and would allow higher order usage of the function. Since the functions in questions are not yet officially released so we still can change them. I don't think this needs a changelog entry for this.