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

4896Re: "ocaml_beginners"::[] unbound value

Expand Messages
  • Java
    Nov 1, 2005
      I'm getting crazy {O.o}

      first of all a very beginner question:
      writing "let rec search x tree" is the same as "let rec search
      (x,tree)"???? (if not pleas someone explain me the difference

      and then, I write a code like this:
      val insert: 'a * 'a tree -> 'a tree

      let rec insert x tree = function
      | Empty -> Node(x, Empty, Empty)
      | Node (y, left, right) ->
      if (x >= y) then Node(y, left, insert x right)
      else Node(y, insert x left, right)

      and the compiler says to me:
      "This expression has type 'a tree -> 'a tree but is here used with type
      'a tree"



      and tomorrow I'm going to take the exam of theese things...
    • Show all 15 messages in this topic