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

1535Re: is this error in ocaml?

Expand Messages
  • vyvepe
    Jan 3, 2004
    • 0 Attachment
      --- In ocaml_beginners@yahoogroups.com, Remi Vanicat
      <remi.vanicat@l...> wrote:

      > by the way, their are other strange things :
      >
      > # let f (x : [ < `A | `B ] ) = x;;
      > Syntax error: ')' expected, the highlighted '(' might be unmatched
      > # let f (x : [ > `A | `B ] ) = x;;
      > val f : ([> `A | `B ] as 'a) -> 'a = <fun>

      OK, it looks like it is fixed in the latest version now. The grammar
      description on the web site is still wrong. The idea is that [ and <
      or [ and > should be written together. It is illegal to put space there.
      Here is an example:

      Objective Caml version 3.07+12 (2004-01-03)
      # let f x:[>|`A|`B] = x;;
      val f : ([> `A | `B ] as 'a) -> 'a = <fun>
      # let f x:[<|`A|`B] = x;;
      val f : ([< `A | `B ] as 'a) -> 'a = <fun>
      # let f (x:[>|`A|`B]) = x;;
      val f : ([> `A | `B ] as 'a) -> 'a = <fun>
      # let f (x:[<|`A|`B]) = x;;
      val f : ([< `A | `B ] as 'a) -> 'a = <fun>
      # let f (x : [ > `A | `B ] ) = x;;
      Syntax error: ')' expected, the highlighted '(' might be unmatched
      # let f (x : [ < `A | `B ] ) = x;;
      Syntax error: ')' expected, the highlighted '(' might be unmatched
      # let f (x : [> `A | `B ] ) = x;;
      val f : ([> `A | `B ] as 'a) -> 'a = <fun>
      # let f ( x : [> `A | `B ] ) = x;;
      val f : ([> `A | `B ] as 'a) -> 'a = <fun>
      # let f ( x : [< `A | `B ] ) = x;;
      val f : ([< `A | `B ] as 'a) -> 'a = <fun>
      # #quit;;
    • Show all 5 messages in this topic