Skip to content

Commit 4428e56

Browse files
author
José Valim
committed
Clarify inspect docs and link to printable boolean functions, closes #9108
1 parent 9310da3 commit 4428e56

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

lib/elixir/lib/inspect/algebra.ex

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,29 @@ defmodule Inspect.Opts do
1313
When `:as_binaries` all binaries will be printed in bit syntax.
1414
1515
When the default `:infer`, the binary will be printed as a string if it
16-
is printable, otherwise in bit syntax.
16+
is printable, otherwise in bit syntax. See `String.printable?/1` to learn
17+
when a string is printable.
1718
1819
* `:charlists` - when `:as_charlists` all lists will be printed as charlists,
1920
non-printable elements will be escaped.
2021
2122
When `:as_lists` all lists will be printed as lists.
2223
2324
When the default `:infer`, the list will be printed as a charlist if it
24-
is printable, otherwise as list.
25+
is printable, otherwise as list. See `List.ascii_printable?/1` to learn
26+
when a charlist is printable.
2527
26-
* `:limit` - limits the number of items that are printed for tuples,
28+
* `:limit` - limits the number of items that are inspected for tuples,
2729
bitstrings, maps, lists and any other collection of items. It does not
28-
apply to strings nor charlists and defaults to 50. If you don't want to limit
29-
the number of items to a particular number, use `:infinity`.
30-
31-
* `:printable_limit` - limits the number of bytes that are printed for strings
32-
and charlists. Defaults to 4096. If you don't want to limit the number of items
33-
to a particular number, use `:infinity`.
30+
apply to printable strings nor printable charlists and defaults to 50.
31+
If you don't want to limit the number of items to a particular number,
32+
use `:infinity`.
33+
34+
* `:printable_limit` - limits the number of characters that are inspected
35+
on printable strings and printable charlists. You can use `String.printable?/1`
36+
and `List.ascii_printable?/1` to check if a a given string or charlist is
37+
printable. Defaults to 4096. If you don't want to limit the number of
38+
characters to a particular number, use `:infinity`.
3439
3540
* `:pretty` - if set to `true` enables pretty printing, defaults to `false`.
3641

0 commit comments

Comments
 (0)