# Suppress confusion! Two suggestions for the online docs (atom\_codes/2, atom\_chars/2)

**URL:** <https://swi-prolog.discourse.group/t/suppress-confusion-two-suggestions-for-the-online-docs-atom-codes-2-atom-chars-2/2231>\
**Category:** Request For Comments\
**Tags:** discussion\
**Created:** [April 26, 2020, 11:44am UTC](https://swi-prolog.discourse.group/t/suppress-confusion-two-suggestions-for-the-online-docs-atom-codes-2-atom-chars-2/2231 "2020-04-26T11:44:27Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [April 26, 2020, 12:31pm UTC](https://swi-prolog.discourse.group/t/suppress-confusion-two-suggestions-for-the-online-docs-atom-codes-2-atom-chars-2/2231/2 "2020-04-26T12:31:19Z")

</div>

I agree that a change may be necessary but not so sure about the specific change as proposed.

Having a personal history as noted in [What type is a single quoted string?](https://swi-prolog.discourse.group/t/what-type-is-a-single-quoted-string/1102) to me this is just the tip of an iceberg. A change should note the ISO Prolog standard and how SWI-Prolog can differ with the use of [Prolog flags](https://www.swi-prolog.org/pldoc/man?section=flags). A change should also show examples of using the type checking predicates such as [atom/1](https://www.swi-prolog.org/pldoc/man?predicate=atom/1), [string/1](https://www.swi-prolog.org/pldoc/doc_for?object=string/1), [is\_list/1](https://www.swi-prolog.org/pldoc/doc_for?object=is_list/1), [is\_of\_type/2](https://www.swi-prolog.org/pldoc/doc_for?object=error%3Ais_of_type/2), and output predicates such as [write\_canonical/1](https://www.swi-prolog.org/pldoc/man?predicate=write_canonical/1), etc. as a user would expect those to be in-sync with the description. This then leads to the idea that an entire bottom up review of all of the related definitions and usages be checked and re-aligned as needed and then this could become a mini-thesis project.

Examples of some predicates for demonstration but not an exhaustive list.

```prolog
?- atom_codes('abc',String).
String = [97, 98, 99].

?- atom_codes('abc',String),string(String).
false.

?- atom_codes('abc',String),error:has_type(text,String).
String = [97, 98, 99].

?- atom_codes('abc',String),error:has_type(chars,String).
false.

?- atom_codes('abc',String),error:has_type(codes,String).
String = [97, 98, 99].

?- atom_codes('abc',String),error:has_type(string,String).
false.

?- atom('string').
true.

?- write_canonical('string').
string
true.

```

So while I agree the idea is noble, I also see it as a potential problem for others learning in the future, as an example from a different concept; while I understood [use\_module/1](https://www.swi-prolog.org/pldoc/man?predicate=use_module/1), having seen [consult/1](https://www.swi-prolog.org/pldoc/man?predicate=consult/1) in a directive confused me ( [Using consult in a directive to load source code; it puzzles me?](https://swi-prolog.discourse.group/t/using-consult-in-a-directive-to-load-source-code-it-puzzles-me/2081)) because it was old but until I learned it was old thought it might be new and the better way to go. Only having asked and getting useful feedback did I learn it was not the way to go. So a user new to Prolog might find conflicting descriptions and then pick the wrong one, which I agree is part of your goal, but also has the potential to add conflicting knowledge. So I believe that any update should also show correct and incorrect ways to use the predicates with SWI-Prolog and also with ISO Prolog in case a user is using another Prolog but reading the description at SWI-Prolog and extrapolating that to the Prolog they are using.

As always feel free to disagree or ignore. 🙂

---

_[View the full topic](https://swi-prolog.discourse.group/t/suppress-confusion-two-suggestions-for-the-online-docs-atom-codes-2-atom-chars-2/2231)._
