
pagaltzis at gmx
Mar 31, 2012, 4:25 AM
Post #26 of 26
(38 views)
Permalink
|
|
Re: [perl #112054] F:S->catdir goes wrong with double slash
[In reply to]
|
|
* demerphq <demerphq [at] gmail> [2012-03-29 10:55]: > Lets be careful we dont fall into the "perfection is the enemy of good > enough" pitfall. > > In other words, yes it might be true that a function like > case_tolerant() fails to handle various edge cases, and yes it might > be the case that one simply *cant* shoe-horn reality into the > abstraction model that case_tolerant() exists within. But that does > not rule out case_tolerant() performing a useful service most of the > time for most of its users. I guess the simplest route to making the API allow for perfection is to redefine case_tolerant as asking “are there *any* case tolerant parts in the path” and adding a function case_sensitive to ask “are there any case *in*tolerant parts in the path” – which can then both be true at the same time, though one of them can be false (but at least one of them has to be true). With that change, existing code can continue to “work” no worse than before, while it awaits fixing to ask both questions. And the API for simple cases remains easy (two predicates to check in a conditional, instead of receiving and testing some kind of compound data structure) – only code that wants to 100% handle all cases in all cases has to use a more complex interface. Plus, an apparently-oxymoronic API just fits Perl’s character. :-) Regards, -- Aristotle Pagaltzis // <http://plasmasturm.org/>
|