GorgeRonde
Joined 13 years ago
Joined 13 years ago
I would have preferred to be told:
- yes and no. You'll get warnings if you try to return a pointer to a local, however, doing this and that, you can manage to do it.
- but once you have achieved that, the result will be dependent on the way the stack is handled (not really in your control). You'll feel some comfort doing this in recursive calls, however beware of signal.h.
But this isn't the answer I received. I guess C programmers do not know the difference between what you can do (however risky) and what you shouldn't do. Also when someone asks such "weird" questions, do not assume he's a beginner with no notion of what constructs he can handle safely, maybe he's someone trying to find the limits of C – and once these limits are identified it can be a good conversation starter about C's internal and the way various compilers differ.
Edit: also downvotes on HN are not like downvotes on Reddit: there's actually a limit (-2 ?). Below this the comment disappears. Conclusion: only downvote when the comment engages in antisocial behavior (not respecting the rules or common human decency, etc ...), not when you disagree with it. I always upvote an unfairly downvoted comment for these reasons.
I do not like this attitude (then again it was just one random dude).
One line of code is just enough to get something that works (defmacro infix [a op b] `(~op ~a ~b))
There are libraries for that too. Clojure: https://github.com/rm-hull/infix
It should also be possible with Node.js I think (node_modules).
https://www.mnn.com/earth-matters/climate-weather/blogs/myst...
Amazing.