8.12

6 Implicit Operators🔗ℹ

In much the same way that #%app and #%datum are implicitly used in many Racket expressions, Rhombus enforestation needs at least two implicit forms: an implicit prefix operator for a non-identifier form by itself (somewhat like #%datum), and an implicit infix operator for the juxtaposition of a parsed form and another form without a binary operator in between (somewhat like #%app). To help enforestation applications avoid a level of indirection between those minimal implicit forms, however, enforestation is parameterized over functions that select implicit prefix and infix forms. The default selection function generates references to the following forms:

In an expression context, a Rhombus language’s #%call implementation most likely creates a function call, #%parens most likely does nothing for a single expression in parentheses (so parentheses can be used for grouping) and might otherwise create a tuple value or return multiple values, #%juxtapose probably reports an error. Implicit operators are likely to have the highest possible precedence and be left-associative, but they are not constrained to those conventions by the Rhombus expander. Implicit operators are likely to be implemented using the macro operator protocol instead of the automatic operator protocol.