Started documenting xml module.
h3rald h3rald@h3rald.com
Sun, 30 Jul 2023 14:05:11 +0000
2 files changed,
67 insertions(+),
0 deletions(-)
M
site/contents/_defs_.md
→
site/contents/_defs_.md
@@ -59,6 +59,12 @@ {{res => [dict:http-response](class:kwd)}}
{{sock1 => [dict:socket<sub>1</sub>](class:kwd)}} {{sock2 => [dict:socket<sub>2</sub>](class:kwd)}} {{m => _min_}} +{{xelement => [dict:xml-element](class:kwd)}} +{{xcomment => [dict:xml-comment](class:kwd)}} +{{xentity => [dict:xml-entity](class:kwd)}} +{{xtext => [dict:xml-cdata](class:kwd)}} +{{xentity => [dict:xml-entity](class:kwd)}} +{{xnode => [xml-node](class:kwd)}} {{pcre => [Perl Compatible Regular Expression](https://www.pcre.org/)}}
A
site/contents/reference-xml.md
@@ -0,0 +1,61 @@
+----- +content-type: "page" +title: "dict Module" +----- +{@ _defs_.md || 0 @} + +{#sig||/||dget#} + +{#sig||%||dset#} + +{#op||ddup||{{d1}}||{{d2}}|| +Returns a copy of {{d1}}. #} + +{#op||ddel||{{d}} {{sl}}||{{d}}|| +Removes {{sl}} from {{d1}} and returns {{d1}}. #} + +{#op||dget||{{d}} {{sl}}||{{any}}|| +Returns the value of key {{sl}} from dictionary {{d}}. #} + +{#op||dget-raw||{{d}} {{sl}}||{{rawval}}|| +Returns the value of key {{sl}} from dictionary {{d}}, wrapped in a {{rawval}}. #} + +{#op||dhas?||{{d}} {{sl}}||{{b}}|| +> Returns {{t}} if dictionary {{d}} contains the key {{sl}}, {{f}} otherwise. +> +> > %sidebar% +> > Example +> > +> > The following program returns {{t}}: +> > +> > {true :a1 "aaa" :a2 false :a3} 'a2 dhas? + #} + +{#op||dkeys||{{d}}||({{s}}{{0p}})|| +Returns a quotation containing all the keys of dictionary {{d}}. #} + +{#op||dpick||{{d1}} {{q}}||{{d2}}|| +> Returns a new dictionary {{d2}} containing the elements of {{d1}} whose keys are included in {{q}}. +> +> > %sidebar% +> > Example +> > +> > The following program returns `{4 :a 7 :d}`: +> > +> > {5 :q 4 :a 6 :c 7 :d "d" :a} ("a" "d") dpick + #} + +{#op||dpairs||{{d}}||({{a0p}})|| +Returns a quotation containing all the keys (odd items) and values (even items) of dictionary {{d}}. #} + +{#op||dset||{{d}} {{any}} {{sl}}||{{d}}|| +Sets the value of the {{sl}} of {{d1}} to {{any}}, and returns the modified dictionary {{d}}. #} + +{#op||dset-sym||{{d}} {{sl}} {{sl}}||{{d}}|| +Sets the value of the {{sl}} of {{d1}} to {{sl}} (treating it as a symbol), and returns the modified dictionary {{d}}. #} + +{#op||dtype||{{d}}||{{s}}|| +Returns a string set to the type of {{d}} (empty if the dictionary has no type). #} + +{#op||dvalues||{{d}}||({{a0p}})|| +Returns a quotation containing all the values of dictionary {{d}}. #}