I've got a nitpick that x.val() in Java is not accurately represented as (val x) in a scheme. there's a few different ways schemes do objects but two common ones are to either:
Treat x as callable and call it with a symbol representing a member method:
(x 'val)
Or have a macro that takes the object and method name as arguments, for example:
(send x val)
I've also seen schemes that have class definitions introduce functions for each method/property so if x is an instance of SomeClass:
Treat x as callable and call it with a symbol representing a member method:
Or have a macro that takes the object and method name as arguments, for example: I've also seen schemes that have class definitions introduce functions for each method/property so if x is an instance of SomeClass: