7.11 Dot Providers
space |
definition | ||||||||||||||||||
| ||||||||||||||||||
|
Two extra options are supported: ~is_static and ~tail. The identifier for ~is_static is bound to #true or #false, depending on whether the use of . to reach the provider was a static or dynamic dot; see use_static. The pattern for ~tail is matched to the tail of the enclosing group after the . and subsequent identifier. If the ~tail pattern doesn’t match, then the case containing the ~tail pattern does not match, which is useful in a multi-case dot.macro form.
The result must be either #false, a syntax object, or two
syntax-object values. A #false result means that static
resolution failed, in which case the . operator will generate
a fallback lookup that is dynamic and generic—
class clause | ||||||||||||||||||||||||
| ||||||||||||||||||||||||
| ||||||||||||||||||||||||
interface clause | ||||||||||||||||||||||||
| ||||||||||||||||||||||||
| ||||||||||||||||||||||||
veneer clause | ||||||||||||||||||||||||
| ||||||||||||||||||||||||
| ||||||||||||||||||||||||
|
The pattern for dot is constrained to have an escape for left_id as the left-hand expression (which has the class or interface annotation), a literal ., and then an identifier for defined_id.
The options and result body are as for dot.macro, except that ~head_stx is also allowed as an option. An identifier after ~head_stx is bound to the called form, either obj_expr.defined_id or name.defined_id(obj_expr).