On Thu, Feb 25, 2010 at 11:13 PM, Petr Rockai <[email protected]> wrote:

> Hi,
>
> Ganesh Sittampalam <[email protected]> writes:
> >>> hardcoded "_darcs/pristine.hashed" is not a good standard, IMO
> >> Dunno. It's easier to write this way and it can't be changed most of the
> >> time (only when we break backward compatibility) and is easy to grep
> >> anyway. It also avoids an extra lookup when reading the code.
> >
> > I think we need to have a separate discussion on darcs-users to establish
> the
> > standard one way or another.
>
> it seems we need a decision whether we should use some sort of
> abstraction over "_darcs/foo" (like a global constant, darcsdir and
> concatenation, or something a little smarter or whatever).
>
> Personally, I don't see a *pragmatic* reason to have this
> abstraction. It neither saves any space/typing nor is it useful to make
> things easier to change coherently (which are the two usual reasons for
> abstracting things). On the other hand, it might make reading source a
> little harder ("what exactly does that constant mean?" ...).
>
> I agree that littering unnamed constants around source is more often a
> bad idea than not, but I am not convinced about this case. On the other
> hand, if there is to be a lengthy flamewar, that outweighs any benefits
> not going through this exercise might have. So to avoid bikeshedding,
> there's a couple ideas, you may add your own, but preferably cast a vote
> in favour of one of these:
>

For what it's worth, Darcs.Global exports darcsdir, where darcsdir =
"_darcs".  I introduced it in this thread:
http://lists.osuosl.org/pipermail/darcs-users/2008-May/011946.html


>
> 1) "_darcs/pristine.hashed"
> 2) darcsdir "pristine.hashed"
> 3) darcsdir hashedPristineDir
> 4) darcsdir HashedPristineDir
> 5) darcsdir HashedPristine
> 6) hashedPristineDir -- includes "_darcs"
> 7) darcsdir ++ "/" ++ "pristine.hashed"
> 8) darcsdir ++ "/" ++ hashedPristineDir
> 9) darcsdir ++ "/" ++ hashedDir HashedPristine
> 10) any of 5-7 with </> instead of ++ "/" ++
> 11) Some variation of the naming. (dir_hashedPristine, ...)
>

When I grep for darcsdir I see places that do the following:
darcsdir ++ "/patches"

I would consider that our de facto standard, but I also have matches like
this:
src/Darcs/Repository/Pristine.hs:           where nold = darcsdir ++ "/" ++
pristineName ++ "-old"

I hope that helps,
Jason
_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to