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

Re: "ocaml_beginners"::[] Re: Help on exercize semantic and synthax

Expand Messages
  • Toby Kelsey
    ... In the expression: if cond then X else Y the types of X and Y must agree, and this is the type of the if expression as a whole. Regards, Toby
    Message 1 of 6 , Oct 7, 2012
    • 0 Attachment
      On 07/10/12 13:30, pinomugo149 wrote:

      > and another question: Ocaml leads that this expr must be of type """(string, int) Hashtbl.t""" becouse in the """ if len = 1 then hash...""" we declare "hashtable type" with "hash"?(that is an Hashtable..)??? and then also "else" must return an hashtable type?? it's right or else can return also a different type?

      In the expression:

      if cond then X else Y

      the types of X and Y must agree, and this is the type of the 'if' expression as
      a whole.

      Regards,
      Toby
    • pinomugo149
      thanks Toby ;)
      Message 2 of 6 , Oct 7, 2012
      • 0 Attachment
        thanks Toby ;)
      Your message has been successfully submitted and would be delivered to recipients shortly.