On this page:
Callable
8.15.0.12

9.7 Callables🔗ℹ

Provided only in the class space, not the annot or namespace space.

An interface that a class can implement (publicly or privately) to make instances of the class callable as functions. The interface has one abstract method, which must be overridden to implement the behavior of function calls:

class Posn(x, y):

  private implements Callable

  private override method call(dx, dy):

    Posn(x + dx, y + dy)

> def p = Posn(1, 2)

> p

#<function:Posn>

> p(3, 4)

#<function:Posn>