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

me at mornfall.net me at mornfall.net
Tue Sep 2 19:54:01 UTC 2008


Hi,

this bundle has two new patches in it, both possibly controversial. They are
both (intended to be) non-functional changes.

(the first patch in a bundle is a resend, since something of the two patches
depends on it, and that power outage is standing in way)

Second factors out repeated definitions and patterns involved in building paths
to hashed files in a CacheLoc. Especially the pattern changes probably want to
be carefully read through for equivalence.

The last one shuffles doSomethingUsingCache to Cache.doSomething -- I prefer
the latter notation, but you might disagree. I find the code neater to read
that way (big endian to the masses).

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.

That's it for now. Maybe I should now move on to do something more constructive
and less bikeshed-prone.

Yours,
   Petr.

Tue Sep  2 03:04:05 CEST 2008  me at mornfall.net
  * Change type of subdir parameter in Cache/HashedIO functions from String to HashedDir.
  
  This refactor should make calling the Cache and HashedIO functions safer: you
  should be no longer able to swap hash and subdir accidentally in the call site,
  or mistype the subdirectory name.

Tue Sep  2 20:57:45 CEST 2008  me at mornfall.net
  * Refactor Cache's handling of hashed paths. No functional change.
  
  Factored out the filepath building to a single place. This also led to folding
  the explicit pattern matches on writability into a predicate, since the other
  components of a CacheLoc are no longer useful in the function bodies.

Tue Sep  2 21:35:59 CEST 2008  me at mornfall.net
  * Use qualified imports and shorter names on Cache functions. No functional change.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-darcs-patch
Size: 77968 bytes
Desc: A darcs patch for your repository!
Url : http://lists.osuosl.org/pipermail/darcs-users/attachments/20080902/f0057be8/attachment-0001.bin 


More information about the darcs-users mailing list