2 ms·
The short answer is: I wanted to experiment and do something different. I thought it was worth looking into the fact that we've become so accustomed to the f(x)
by Udo 14y ago
The short answer is: I wanted to experiment and do something different. I thought it was worth looking into the fact that we've become so accustomed to the f(x) form, when more logically the function should form a more obvious unit with its parameters.
However, I have to admit that it still takes some getting-used-to even for me. Maybe there is something about f(x) that is inherently more readable then (f x), but I'll reserve my judgement for a week weeks.
- akkartik 14y agoI'll be curious to hear more over the coming weeks. Email in profile. (I have a dog in this fight, but I'll avoid saying more right now and wait for you to settle on a position :)
- stormbrew 14y agoI don't think I've seen it argued before that (f x) is a more obvious form than f(x). Usually the argument for (f x) is premised on a lisp-based idea of homoiconicity (code/data parity). The reason f(x) seems more obvious in meaning, to me at least, is that f is a thing and (x) is a message or application I'm giving it.
- pash 14y agoThe traditional syntax really falls down when your functions are curried and you want to do partial application. In that context, as in Haskell, the f x_1 ... x_n syntax is as natural as it gets.
- goldfeld 14y agoI have been coding CoffeeScript for a while and slowly got rid of it's parentheses down to doing `do someFunction`. When I learned about Clojure and got excited to learn it (but haven't yet), I also gradually shifted my aesthetics to using (someFunction param1, param2) in CoffeScript every time that was needed for making it unambiguous (e.g. chained function calls), and now I consider someFunction(param) a most hideous invocation. But (fn x y) is even nicer. I have noticed you allow for optional commas when invoking multiple parameters. Overall I love your syntax decisions, maybe I'm partial for liking lispy-ness and lambda syntax, but still it's refreshing to see someone experimenting beyond all the C-ness that pervades us. I feel like there's a dash of Rust and a sprinkle of Haskell too. Nice work! And if you keep development I might actually consider using this for a project or two in the future.
- Udo 14y ago> I have noticed you allow for optional commas when invoking multiple parameters. Yes, but they're thrown away by the lexer. I'm actually still on the fence about some of these details. > And if you keep development I might actually consider using this for a project or two in the future. That's great to hear, thanks! There is still a TON of bugfixing and fleshing-out of the runtime library to do, but when it's ready I'll be doing a project with it as well. Gotta see how it all holds up under pressure!