Macaw.Frame.Contract (macaw_frame v0.1.0)

Copy Markdown View Source

What the Frame needs from macaw_component's contract and macaw's core, and which of it has landed (spec/01 §9, spec/05 §9): one table, so every fallback is read in one place and each switches on where its addition lands.

AdditionWherePresentUntil it lands
:variablesvariables/1, qualified parametersyes (macaw_component 0.12)—
:reducerreducer/3, reducer/4 in the slot's requestyes (0.12)—
:requestrequest/2, a hook's request transitionyes (0.12)—
:clockclock/2, the easing clockyes (0.12)—
:carryinit/3, initialized from the value replacedyes (0.12)—
:ratioContext.ratio, read by budget/4 and reducer/4yes (0.12)—
:motionContext.motionyes (0.12)—
:tickstick_interval/1, tick/2yes (0.12)—
:measured_sizea hook's macaw:size reportyes (0.12, Client.reportSize)—
:window_widenedwindow taking a number range and a :point box (macaw#340)noa brush or zoom over a number x and a geographic view declare no window write; their events are mapped by a cell action
:observationa hook's observes report carried to the host (macaw#167)nothe hooks report nothing; the Frame still declares its observations
:selection_fieldsthe core handing selection in a cell's fields (macaw#340)noa Frame draws no selection it is not handed in fields; picking still writes it

macaw_component 0.12 landed every addition of its own contract (macaw_component#54), so the rows still absent are the core's (dco-tek/macaw/macaw#340, macaw#167). The ratio's row means spec/05 §2.5's fallback, budgets at resolution 1, is no longer the Frame's: budget/4 and reducer/4 read context.ratio, and only a host calling budget/3 reads ratio 1.

Summary

Types

An addition of spec/01 §9's table.

Functions

The additions still absent, each running on its stated fallback.

Every addition of spec/01 §9, those present first.

Whether an addition has landed, so the Frame takes it rather than its fallback; false for a name the table does not hold.

Types

addition()

@type addition() ::
  :variables
  | :reducer
  | :request
  | :clock
  | :carry
  | :ratio
  | :motion
  | :ticks
  | :measured_size
  | :window_widened
  | :observation
  | :selection_fields

An addition of spec/01 §9's table.

Functions

absent()

@spec absent() :: [addition(), ...]

The additions still absent, each running on its stated fallback.

additions()

@spec additions() :: [addition(), ...]

Every addition of spec/01 §9, those present first.

iex> length(Macaw.Frame.Contract.additions())
12

present?(addition)

@spec present?(term()) :: boolean()

Whether an addition has landed, so the Frame takes it rather than its fallback; false for a name the table does not hold.

iex> {Macaw.Frame.Contract.present?(:ratio), Macaw.Frame.Contract.present?(:window_widened)}
{true, false}