./T and ./T >& log

Lennart Augustsson lennart at augustsson.net
Fri Feb 20 04:56:36 EST 2009


I'm just guessing, but it looks like a buffering problem.
When a program dies an abnormal death (like the "Bug:" thing probably
is) then the stdout buffer is not flushed and you'll miss that bit of
the output.
You could set stdout in NoBuffering mode and see if that helps.

  -- Lennart

On Fri, Feb 20, 2009 at 9:38 AM, Serge D. Mechveliani <mechvel at botik.ru> wrote:
> People,
> I observe the output difference in running  ./Bug
> and                                         ./Bug >& log
> (under Linux) for the program
>
>  import Dumatel
>  main = do calcInput <- readFile "List0.inp"
>            (putStr $ parseComputeShow calcInput)
>    where
>    parseComputeShow calcInput =  concat ["t =  ",   showsn 3 t "\n",
>                                          "tR =  ",  showsn 3 tR "\n"]
>      where
>      calc = addInput_default nilParseOpts (bool rpos) calcInput
>      t    = parse_default calc "parsing Term"  "(a:nil) + (b:nil)"
>      tR   = evaluate emptyUMRMemo AllRules calc t
>
> -- I think, it can be reduced to much simpler one.
> The error break has to occur while computing  tR.
> The difference is in printing or skipping of the result part before tR.
> The first command outputs
>
>  ---------------------------------
>    t =  ((a : nil) + (b : nil))
>  Bug:
>  substitute {(X, a), (Xs, nil), (Ys, (b : nil))} X:
>  sort mismatch in substitution
>  ---------------------------------
>
> And the second command skips (in  ./log) the line of   t = ...
> Who can tell what is the matter?
> How to have identic outputs in this example?
>
> Thank you in advance for explanation.
>
> -----------------
> Serge Mechveliani
> mechvel at botik.ru
>
>
>
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>


More information about the Glasgow-haskell-users mailing list