eval: rethink closedness #3757
Labels
closedness
FeatureRequest
New feature or request
roadmap
High level umbrella issue laying out important roadmap goals
Closedness in CUE is an important part of improving the user experience when it comes to detecting errors early:
apple
but accidentally typedapole
, we can detect they specified a field that "do not exist" within some reference schema and tell them at the point of declaration, as opposed to a more distant place where the containing value is ultimately used.CUE has two mechanisms for introducing closedness:
close()
builtin closes a struct or list argument, but not recursively.Values that are closed, recursively or otherwise, have that closedness "relaxed" during an embedding, and the resulting structure is then closed.
This issue exists to gather:
The
closedness
label is used to mark all related issues for easy discovery: closednessThe list that follows is in no particular order and by no means complete. It is in effect an attempt to distill thoughts from the issues seen over time:
cue.mod/usr
or aspect oriented package-level augmentations in the main module. But even with such augmentations, it's arguably impossible for the importer to do anything further at the point of importing. As such, closing such a package value helps to shift left errors where references to non-existent fields are caught early. The discussion in that thread is picked up in packages: close package values on import? #3772 to continue discussion on that point.The text was updated successfully, but these errors were encountered: