Re: type and type string option
| Newsgroups | gmane.comp.lang.ocaml.beginners |
|---|---|
| Message-ID | <[email protected]> |
O_O OK, it all makes sense now. Thanks you cedlemo On 19/05/2016 15:41, Pierpaolo Bernardi wrote: > On Thu, May 19, 2016 at 3:27 PM, cedlemo [email protected] > [ocaml_beginners] <[email protected]> wrote:> >> First I have read the documentation of Sys: >> >> val getenv : string -> string >> Return the value associated to a variable in the process environment. >> Raise Not_found if the variable is unbound. > This is the documentation for the function getenv in the Sys module in > the standard library. But you are using the function getenv from the > Sys module in the Core library, which is a different library. So you > should read the documentation for the Core library. > >>> Since you're using core, `Sys.getenv` returns a string option >> Does that mean that like in the documentation Sys.getenv returns a >> string but when used used with the Core module it returns a string option ? > they are two different functions which do different things. Yes, they > have the same name. Yes, they reside in modules with the same name. > Yes, someone thought this was a good idea. No, I don't know what they > were smoking.