Yes. From a fully functional point of view (for example, in Haskell) all functions ( Really all ).
And since a purely functional language prohibits any changes, this definition does not bear any contradictions.
Is there any difference?
Well, OCaml is not purely functional. This means that functions can perform side effects that are slightly different from determining a constant value.
This code (F # here - but very similar in Caml) would be absolutely right.
let name = Console.Write("Enter your Name: ") Console.ReadLine()
Dario source share