[darcs-users] darcs patch: Resolve issue1229: strictify checkPristineAgainstSlurpy.

Dmitry Kurochkin dmitry.kurochkin at gmail.com
Wed May 27 19:58:31 UTC 2009


Hi all.

On Wed, May 27, 2009 at 11:49 PM, Petr Rockai <me at mornfall.net> wrote:
> Reinier Lamers <tux_rocker at reinier.de> writes:
>> It might be a good idea to add a comment to checkPristineAgainstSlurpy that
>> it may throw exceptions, and that explains the strictification. A patch
>> adding such comment is attached.
> Thanks.
>
>> Writing this comment prompted me to wonder why darcs runs code that throws
>> exceptions inside unsafeInterleaveIO. That's asking for trouble. I think the
>> real solution would be to move the catch inside the unsafeInterleaveIO and
>> have the unsafeInterleaveIO'd function return a Maybe or Either.
> Well, this is sort of "by design" in the SlurpDirectory code. Simply removing
> the interleaving would likely lead to all sorts of performance and memory
> issues. Wrapping things up probably wouldn't work very well either.

If I understand correctly Reinier suggests moving catch inside
unsafeInterleaveIO, not removing interleaving. I think that should
work. But I may be missing something.

Regards,
  Dmitry

>
> Anyhow, the in the grand scheme of things, I will eventually remove
> SlurpDirectory altogether, which will take most of the IO interleaving with it
> as well. (This also means Darcs.Diff and lots of other code that depends on
> slurping -- so that's still a whole lot of work to do, and probably won't be
> done before darcs 3, so we'll have to cope with unsafeInterleaveIO in the
> meantime.)
>
> Yours,
>   Petr.
>
> --
> Peter Rockai | me()mornfall!net | prockai()redhat!com
>  http://blog.mornfall.net | http://web.mornfall.net
>
> "In My Egotistical Opinion, most people's C programs should be
>  indented six feet downward and covered with dirt."
>     -- Blair P. Houghton on the subject of C program indentation
> _______________________________________________
> darcs-users mailing list
> darcs-users at darcs.net
> http://lists.osuosl.org/mailman/listinfo/darcs-users
>


More information about the darcs-users mailing list