Skip to content
Myr

Document getpath/setpath

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Nicolas Williams · committed by Nicolas Williams · parent ec7c3cf · Browse files · 1 file+30 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+30 added−0 removed

  • other:+30 added−0 removed

1 file+30 added−0 removed

modified:docs/content/3.manual/manual.yml+30 added
768 unmodified lines
769 - program: 'del(.[1, 2])'770 input: '["foo", "bar", "baz"]'771 output: ['["foo"]']772773 - title: "`gepath(PATHS)`"774 body: |775776 The builtin function `getpath` outputs the values in `.` found777 at each path in `PATHS`.778779 examples:780 - program: 'getpath(["a","b"])'781 input: 'null'782 output: ['null']783 - program: '[getpath(["a","b"], ["a","c"])]'784 input: '{"a":{"b":0, "c":1}}'785 output: ['[0, 1]']786787 - title: "`sepath(PATHS; VALUE)`"788 body: |789790 The builtin function `setpath` sets the `PATHS` in `.` to `VALUE`.791792 examples:793 - program: 'setpath(["a","b"]; 1)'794 input: 'null'795 output: ['{"a": {"b": 1}}']796 - program: 'setpath(["a","b"]; 1)'797 input: '{"a":{"b":0}}'798 output: ['{"a": {"b": 1}}']799 - program: 'setpath([0,"a"]; 1)'800 input: 'null'801 output: ['[{"a":1}]']802803 - title: "`to_entries`, `from_entries`, `with_entries`"804 body: |805806 These functions convert between an object and an array of
2129 unmodified lines