8.16.0.4
5 Dynamic Dot from Racket
(require rhombus/dot) | package: rhombus-lib |
The Rhombus dot operator can be used via rhombus-expression, but the rhombus/dot module provides a simpler and more convenient interface for dynamic access of object fields, methods, and properties.
To dynamically access dotted names that (statically) go through Rhombus namespaces, see Dynamic Require of Rhombus Exports.
procedure
(dynamic-dot-ref obj name) → any/c
obj : any/c name : symbol?
Accesses a field, method, or property name from obj.
An exception is raised if no such member exists in obj.
procedure
(dynamic-dot-set! obj name val) → any/c
obj : any/c name : symbol? val : any/c
Modifies obj to set the field or property name in
obj to val. An exception is raised if no such mutable
member exists in obj.