On this page:
new
make_  object
send
is_  a
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.

expression

rkt_obj.new expr(keyword: expr, ...)

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

rkt_obj.make_object expr(expr, ...)

Rhombus syntax for Racket’s make-object, which instantiates a Racket class with by-position initialization arguments.

expression

rkt_obj.send expr . name(arg, ...)

 

arg

 = 

expr

 | 

keyword: body

Rhombus syntax for Racket’s send, which calls a method of an object.

expression

object_expr rkt_obj.is_a class_expr

Rhombus operator version of Racket’s is-a?.