4 ms·
I laughed when I saw this: "If your function crashes upon error, you should append OrDie to the function name.", and then as an example: "OpenFileOrDie". Lol.
by joedavis512 16y ago
I laughed when I saw this: "If your function crashes upon error, you should append OrDie to the function name.", and then as an example: "OpenFileOrDie". Lol.
- xentronium 16y agoI thought it was an old perl convention. do_something or die "Somebody set up us the bomb"
- mahmud 16y agoWhat if that was an actual semantic transformation in the language? Naming something XorDie would execute the body of X in a context within which all errors are caught, and if any is found, the call returns NIL or similar? Easily doable with handler-case, unwind-protect and reader macros, but ugly as sin.
- rudiger 16y agoWe do the same thing with getX and setX; it would be interesting to see more "meaningful" function names in a language.