3 ms·
fn is my favorite keyword for function definition. "function" is too long. "def" doesn't say anything about functions (unless you read it as DEfine Function). "
by xiaq 12y ago
fn is my favorite keyword for function definition. "function" is too long. "def" doesn't say anything about functions (unless you read it as DEfine Function). "func" sounds too funny. "defun" always reads "defunct" to me.
And just out of curiosity, where did the rust designers get the inspiration for "fn"? I know plan 9 rc and clojure have "fn". Or maybe it's independent invention?
- dbaupp 12y agoAnonymous functions in ML, possibly.
- pcwalton 12y agoWell, I slightly prefer "fun", but the Rust community pretty firmly favors "fn", and they're about the same anyway. As far as I know it came from ML.
- xiaq 12y ago"fun" is even funnier than "func"! ML etymology sounds pretty plausible (I didn't know ML uses fn) since I can see there is a strong influence of ML on Rust.