http://qs321.pair.com?node_id=1211408


in reply to Re^3: Is there any way to override "file test operator"?
in thread Is there any way to override "file test operator"?

The benefit of overloading it, is that existing code "does the right thing", given whatever the new underlying context is, everyone can use the old idioms, even though they aren't quite the same.

In fact, a good overload would not lose functionality on normal arguments. For instance, what if someone wanted to instrument logging by absolute filename, to collect statistics? Extending -e to do this would be easier than replacing every file test operator call everywhere, including external packages.

For these kinds of questions, it's better if we get a real sense of the OP's ultimate goal and purpose, before declaring "that's a bad idea" just because it usually is.

-QM
--
Quantum Mechanics: The dreams stuff is made of