The following example is kinda funny: // This is obviously not too right ",".splitBy("1,2,3,4,5") // This should be right, because it reads out more naturally "1,2,3,4,5".splitBy(",") Seeing as Python uses the first version for .join()
Yeah Python (and I think JavaScript?) pretty clearly have `join` backwards.
Motivation – Keli Language
11–20 of 300 posts
Re: Motivation – Keli Language
#12The following example is kinda funny: // This is obviously not too right ",".splitBy("1,2,3,4,5") // This should be right, because it reads out more naturally "1,2,3,4,5".splitBy(",") Seeing as Python uses the first version for .join()
Python 3.8.2 (default, Jul 16 2020, 14:00:26)
>>> " ".join(["a", "b"])
'a b'
vs Ruby 2.6.5 :001 > ["a", "b"].join(" ")
=> "a b"
I don't know which one is more natural but I prefer the Ruby version because it's consistent with "a b".split(" ")
which works in both languages. One less think to remember.Re: Motivation – Keli Language
#13The only unconventional thing is that the function might be put in-front of the value and some parentheses need to be added, instead of just putting it after the cursor like with method syntax. I assume you get used to that rather quickly.
Re: Motivation – Keli Language
#14Re: Motivation – Keli Language
#15Syntactic window dressing isn’t what makes or breaks a language.
Re: Motivation – Keli Language
#16Re: Motivation – Keli Language
#17While I could get onboard with functional languages being more user friendly I didn't find the motivation to be compelling. > Ambiguous functions argument positions It just seems to be advocating for named arguments, something which the majority of languages (OO or FP) support these days. You could say that requiring named parameters is a feature but it's hard to get excited about. > Not Intellisense friendly I use E…
Re: Motivation – Keli Language
#18Re: Motivation – Keli Language
#19 splitStringBy "1,2,3,4,5" ","
^ action
^ Arg1
^ Arg2Re: Motivation – Keli Language
#20Plus, named and named-optional parameters are supported in the language, and can be used to good effect for disambiguating function parameters of similar type (the split, join problem).