Loading ...
Sorry, an error occurred while loading the content.

9996Re: "ocaml_beginners"::[] Function executed more than once in recursion?

Expand Messages
  • hmf@inescporto.pt
    Aug 1, 2008
    • 0 Attachment

      Martin Jambon wrote:
      > On Fri, 1 Aug 2008, hmf@... wrote:
      >> Hello,
      > Without looking deeply at your code, I suspect that your problem is in:
      > expr1 :: expr2
      > You can't assume that expr1 will be evaluated before expr2.

      Which I did in fact.

      > Always do:
      > let x = expr1 in
      > x :: expr2
      > And sorry if it's not the cause of your problem...

      That's it! I was already thinking of race-conditions and what not.

      I was not understanding why the similar functions:
      Bdd.ithvar man i in
      Bdd.newvar_at_level man i in
      Bdd.newvar man in

      which create variables did not generate the same results.
      The problem is "Bdd.newvar_at_level man i" shifts the variables
      for a given level "i" to make room for new ones. I had assumed
      I was going through the levels in order, hence expected no

      A quick test shows that a call "Bdd.newvar_at_level man i"
      with "i" in inverse order generates those extra variables.

      Merci beaucoup,
      Hugo F.

      > Martin
      > --
      > http://mjambon.com/
      > ------------------------------------
      > Archives up to December 31, 2007 are also downloadable at
      > The archives of the very official ocaml list (the seniors' one) can be found
      at http://caml.inria.fr
      > Attachments are banned and you're asked to be polite, avoid flames etc.Yahoo!
      Groups Links
    • Show all 3 messages in this topic