* dpuu <[EMAIL PROTECTED]> [2008-11-24 00:40]: > I agree that the specific example of &chown.is_restricted is a > bad idea, but only because the POSIX API I was wrapping is > itself flawed.
It is not flawed in the least, as far as the aspect we are talking about is concerned. (It is generally sane in far more ways than it is flawed.) > In general I would continue to pursue the approach of adding > precondition-checks as methods on functions, a concept that is > orthogonal to the specific example you are arguing against In general? Sure. But for filesystem operations? Bad idea. > I disagree that the code I showed is not simpler that the > original S16 approach. I don’t see any examples in S16 concerning error handling anyway, but even so I don’t see how relying on exceptions would could possibly be more complex than guard clauses. You *still* have to handle errors after the guard clause passes and the operation is attempted. Regards, -- Aristotle Pagaltzis // <http://plasmasturm.org/>