diff options
author | Andrew Bennett <potatosaladx@meta.com> | 2023-01-25 10:19:14 -0600 |
---|---|---|
committer | Andrew Bennett <potatosaladx@meta.com> | 2023-01-26 12:19:22 -0600 |
commit | bc5deade16a723202fef4bf40e61b1e6830fd088 (patch) | |
tree | d4d6a416412d0e863e5cce41f7a34690892ed3d9 /lib/stdlib/doc | |
parent | a05a451bd15c955046915b4286e39b3c57ece944 (diff) | |
download | erlang-bc5deade16a723202fef4bf40e61b1e6830fd088.tar.gz |
Update documentation for the io and io_lib modules
Diffstat (limited to 'lib/stdlib/doc')
-rw-r--r-- | lib/stdlib/doc/src/io.xml | 40 | ||||
-rw-r--r-- | lib/stdlib/doc/src/io_lib.xml | 4 |
2 files changed, 41 insertions, 3 deletions
diff --git a/lib/stdlib/doc/src/io.xml b/lib/stdlib/doc/src/io.xml index faadbcc574..a4f18e404c 100644 --- a/lib/stdlib/doc/src/io.xml +++ b/lib/stdlib/doc/src/io.xml @@ -177,9 +177,43 @@ ok</pre> <item> <p><c>Mod</c> is the control sequence modifier. This is one or more characters that change the interpretation of - <c>Data</c>. The current modifiers are <c>t</c>, for Unicode - translation, and <c>l</c>, for stopping <c>p</c> and <c>P</c> - from detecting printable characters.</p> + <c>Data</c>.</p> + <p>The current modifiers are:</p> + <taglist> + <tag><c>t</c></tag> + <item> + <p>For Unicode translation.</p> + </item> + <tag><c>l</c></tag> + <item> + <p>For stopping <c>p</c> and <c>P</c> from detecting + printable characters.</p> + </item> + <tag><c>k</c></tag> + <item> + <p>For use with <c>p</c>, <c>P</c>, <c>w</c>, and <c>W</c> + to format maps in map-key <c>ordered</c> order (see + <seetype marker="maps#iterator_order">maps:iterator_order()</seetype>).</p> + </item> + <tag><c>K</c></tag> + <item> + <p>Similar to <c>k</c>, for formatting maps in map-key order, + but takes an extra argument that specifies the + <seetype marker="maps#iterator_order">maps:iterator_order()</seetype>.</p> + <p>For example:</p> + <pre> +> <input>M = #{ a => 1, b => 2 }.</input> +#{a => 1,b => 2} +> <input><![CDATA[io:format("~Kp~n", [fun(A, B) -> B =< A end, M]).]]></input> +#{b => 2,a => 1} +ok</pre> + </item> + </taglist> + <!-- <list type="bulleted"> + <item><p><c>t</c>, for Unicode translation.</p></item> + <item><p><c>l</c>, for stopping <c>p</c> and <c>P</c> + from detecting printable characters.</p></item> + </list> --> </item> </list> <p>If <c>F</c>, <c>P</c>, or <c>Pad</c> is a <c>*</c> character, diff --git a/lib/stdlib/doc/src/io_lib.xml b/lib/stdlib/doc/src/io_lib.xml index 3b7aea529e..30d02a59a1 100644 --- a/lib/stdlib/doc/src/io_lib.xml +++ b/lib/stdlib/doc/src/io_lib.xml @@ -92,6 +92,10 @@ <item><p><c>strings</c> is set to <c>false</c> if modifier <c>l</c> is present.</p> </item> + <item><p><c>maps_order</c> is set to <c>undefined</c> by default, + <c>ordered</c> if modifier <c>k</c> is present, or <c>CmpFun</c> + if modifier <c>K</c> is present.</p> + </item> </list> </desc> </datatype> |