OCaml has had labeled arguments for decades, so I assumed other languages would have added something similar by now. In C-style, it would be like: createUser(user, ~isAdmin:true, ~sendWelcomeEmail:false) Even though in OCaml's functional style it is actually like this: createUser user ~isAdmin:true ~sendWelcomeEmail:false Using the fact that a variable named exactly like a labeled argument is automatically assigned t…
pub fn pad_end(
string: String,
to desired_length: Int,
with pad_string: String,
) -> String
And a call to this function may look like: pad_end("123", to: 5, with: ".")