I’m confused by Observable’s use of the word “operator” in their documentation, and wondering whether they have misused it, or I’m simply not understanding.
Observable has a special
viewof
operator which lets you define interactive values. A view is a cell with two faces: its user interface, and its programmatic value.
viewof text = html.html`<input value="edit me">
The
viewof
operator namedtext
renders a text field. The value of that field can be accessed elsewhere by callingtext
.
https://observablehq.com/documentation/cells/observable-javascript
In this context, the bit to the right of = is JavaScript, and the bit to the left is special Observable syntax. text =
is what they call a variable assignment (similar-ish to a JS variable declaration).
Adding viewof
beforehand changes the semantics of the declaration, similar (to me) to how one might add public
or static
before declarations in other contexts.
(Observable has another such “operator”, mutable
).
Is it reasonable to describe this as an “operator”? And if not, what would a better term be?