Should the "viewof" keyword be renamed?

When posting to [A bit confused about 'mutable', etc], I settled to the terminology:

  • (user) input cell – cells that can receive user input
  • (programmatically) mutable cell – cells that can receive new data, programmatically, i.e. defined with mutable

The former are typically defined with viewof, but not necessarily, and often you see the pattern where the cell in question just defines some routines that track user input and store it elsewhere, say in a mutable.

Whereas not all user input cells are viewofs, all viewofs are of course indeed user input cells.

My question then, is: The keyword name viewof refers to the concrete situation which is erected, namely, two objects: the data itself, and the view of the data. I.e., it is a kind of an implementation denoting term, just like Java likes to use class names like LinkedList or HashMap. But maybe it would be better if the keyword would denote the conceptual function, as is already the case with mutable? (Just like C# uses class names that denote the ‘shape’ in question, e.g. Dictionary instead of HashMap.)

userinput d = { ...; return svg; }

Both mutable and viewof allow a cell to receive input, the former programmatically, the latter via user input. The former has a name that implies that this is the case, while the latter has a name that describes the underlying mechanism by which it … could be the case.

If I understand you correctly, you are suggesting that fields that have a User Interface (UI) element, be labeled as “userinput” rather than viewof. viewof can do much more than user input. You can define a view of any type of javascript object yourself and have it give you a different user interface element than the value that is passed to other cells, thus the variable becomes a view into (viewof) a more complicated object.

So you can have a table that has a value of the currently selected row and that value is seen through the viewof that table. Other cells see that row and not the entire value. You can have an object, say a custom list that keeps track of the current index being traversed. This could have a value that is the current object at that index. Other cells need a viewof that value. So there is definitely a need to have viewof.

I personally would not want userinput to be used as a keyword for anything that didn’t have a User Interface object thad doesn’t have interactivity. An SVG for example, that doesn’t have interactivity would not, in my opinion be a “userinput” if that was created.

viewof definitely refers, in my mind, to the types of elements that may present a view for the dom, and another view to the cells that reference it.