You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently, there is no way to access the data contained in metavalues, in particular the documentation, which limits their usefulness.
Describe the solution you'd like
Add a query sub-command to the interpreter which shows the metadata associated to a value. One could provide a field path: nickel -f input.ncl query foo.bar which would be equivalent to evaluating let x = import "input.ncl" in x.foo.bar and look at the metadata. If x.foo.bar is a record without contract, it could also list all fields and associated metadata of this record. Long flag may specify which part of the meta value once is interested in, e.g. --doc, --contract, --default, etc.
The documentation could also be formatted following Markdown (using termad).
Example (this is illustrative, not necessarily the right output formatting):
The syntax of the field path may also be more general, such as a term with a hole, which would allow stuff like _.$"^$foo%".baz. The future REPL should also have a similar command, but this is a separate issue.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Currently, there is no way to access the data contained in metavalues, in particular the documentation, which limits their usefulness.
Describe the solution you'd like
Add a
query
sub-command to the interpreter which shows the metadata associated to a value. One could provide a field path:nickel -f input.ncl query foo.bar
which would be equivalent to evaluatinglet x = import "input.ncl" in x.foo.bar
and look at the metadata. Ifx.foo.bar
is a record without contract, it could also list all fields and associated metadata of this record. Long flag may specify which part of the meta value once is interested in, e.g.--doc
,--contract
,--default
, etc.The documentation could also be formatted following Markdown (using termad).
Example (this is illustrative, not necessarily the right output formatting):
The syntax of the field path may also be more general, such as a term with a hole, which would allow stuff like
_.$"^$foo%".baz
. The future REPL should also have a similar command, but this is a separate issue.The text was updated successfully, but these errors were encountered: