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

Getting "Unbound record field mid_x"

$
0
0

I am not understanding why I am getting this error: Unbound record field mid_x when running this code. What the function midpoint_segment is trying to do is find the midpoint of a given type segment and return a point type.

type point =   {x : float; y : float} type segment =   {startp : point; endp : point}let midpoint_segment {startp; endp} =  let mid_x = (startp.x +. endp.x) /. 2.0 in  let mid_y = (startp.y +. endp.y) /. 2.0 in  {mid_x; mid_y}

What does this error mean? I am defining mid_x and mix_y with let.


Viewing all articles
Browse latest Browse all 518

Trending Articles



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