3 ms·
I don't see how a keyword that allows return values to be ignored creates an incentive to create void functions. I sort of find the idea refreshing myself. As
by KirinDave 10y ago
I don't see how a keyword that allows return values to be ignored creates an incentive to create void functions.
I sort of find the idea refreshing myself. As a full time Clojure developer, I consider Nim to be the closest thing I can find to what I want for a great experience coding closer to the bare metal.
- drewr 10y agoCan you say more about what you like?
- qwertyuiop924 10y agoIt's not so much that it allows it to be ignored, it's that if you want it to be ignored, you have to use that keyword. It means that there's syntactic noise in cases where you don't care about the return value of a function that has one, and thus discourages you from writing functions like that.
- dom96 10y agoThe idea behind this feature is to ensure that you don't lose important data, not to discourage you from writing functions which return values. For cases where a functions return value is truly optional, you can use the {.discardable.} pragma.
- qwertyuiop924 10y agoHuh. Interesting idea. I suppose that could work. I'm still not wholly convinced that Nim is for me, but you've definitely alleviated some of my biggest concerns.