[darcs-users] darcs patch: Change type of subdir parameter in Cache... (and 2 more)

David Roundy droundy at darcs.net
Wed Sep 3 11:05:05 UTC 2008


On Tue, Sep 02, 2008 at 09:54:01PM +0200, me at mornfall.net wrote:
> Now, since I have already converted two of my controvesial ideas into patches,
> I'll ask about the last one before taking action. I suggest adding following
> aliases to improve code readability (names are subject to debate, I suppose):
> 
> mkdir = createDirectoryIfMissing False
> mkdirRecursive = createDirectoryIfMissing True
> mkdirNew = createDirectory
> 
> This change would be a somewhat carnage-ish, changing something like of 16
> modules. However, I'm admittedly driven up the wall by
> "createDirectoryIfMissing False" from which it is somewhat hard to decipher as
> what it actually does.

I agree that writing nicer replacements for createDirectoryIfMissing would
be a good idea, but I'm not sure I like your very short names.  I think I'd
actually lean towards going with Jason's suggestion.  It's a bit weird
defining a function with the same name as a standard library function, but
I think that's all right, since it's meant to be a replacement for that
function (and is itself pretty obvious).  And its name is really the name
we want (since that's what it does).

I'd definitely not redefine createDirectory, which is a perfectly harmless
little function.

David


More information about the darcs-users mailing list