ordo
ordo copied to clipboard
Support something similar to . and : from lua
Since some records might have something similar fields that would be similar to members in F#, we might want a notation to allow calling the member of a record with the record itself being passed as the first argument, similar to the way .
and :
works in lua.
For example
let record = { a = 1, b = 2, add = fun r -> r.a + r.b }
let list_of_records = (* something *)
list_of_records
|> List.map (fun record -> record.add)
(* bad *)
list_of_records
|> List.map (.add)