Quantcast
Channel: Active questions tagged ocaml - Stack Overflow
Viewing all articles
Browse latest Browse all 527

I don't understand why the result of the last statement is 6

$
0
0
let x = 2;;let x = 3in let y = x +1    in x + 1;;let x = 3 and y = x + 1 in x + y;;

The results are ordered respectively to each expression:

val x : int = 2- : int = 7- : int = 6

Can you help me understand why the last expression equals 6, it's hard for me to understand it.

I run this code in tryOCamlpro.


Viewing all articles
Browse latest Browse all 527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>