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

Re: "ocaml_beginners"::[] Is there similar function print_any as F# in OCaml ?

Expand Messages
  • Richard Jones
    ... It s not possible, at least not in pure OCaml. Have a look at Std.dump in extlib. Rich. -- Richard Jones, CTO Merjis Ltd. Merjis - web marketing and
    Message 1 of 8 , Sep 1, 2006
      On Wed, Aug 30, 2006 at 03:15:42PM -0000, LORENZO wrote:
      > Since I just want to know the built-in type of
      > the parameter enter to a function, I tried
      >
      > #let testype x =
      > if x <> 0 or x = 0 then
      > Printf.printf "%d\n" x
      > else if ( x <> 1. or x = 1. ) then
      > Printf.printf "%f\n" x
      > ;;
      > Characters 100-102:
      > else if ( x <> 1. or x = 1. ) then
      > ^^
      > This expression has type float but is here used with type int

      It's not possible, at least not in pure OCaml.

      Have a look at Std.dump in extlib.

      Rich.

      --
      Richard Jones, CTO Merjis Ltd.
      Merjis - web marketing and technology - http://merjis.com
      Team Notepad - intranets and extranets for business - http://team-notepad.com
    Your message has been successfully submitted and would be delivered to recipients shortly.