Hacker News new | ask | show | jobs
by cube2222 3152 days ago
Not in OCaml. You can have a function like that:

let printAge object = print object.age

And it'll just check if anything passed to printAge has a field "age".