9.0.0.5
3.2 Racket Classes and Objects from Rhombus
| import: rhombus/rkt_obj | package: rhombus-lib |
The rhombus/rkt_obj library provides Rhombus syntactic forms for instantiating Racket classes and working with instances.
Rhombus syntax for Racket’s new, which instantiates a Racket
class with keyword initialization arguments.
The Racket new form uses identifiers for “keyword” arguments, but only because it predates the addition of keywords to Racket. Along the same lines as noted in Common Run-Time Representations, a Racket “keyword” initialization argument such as fast? can be written with rkt_obj.new as ~#{fast?}.
expression | |
|
Rhombus syntax for Racket’s make-object, which instantiates a
Racket class with by-position initialization arguments.
Rhombus syntax for Racket’s send, which calls a method of an
object.
expression | |
|
Rhombus operator version of Racket’s is-a?.