# term\_string('A', "'A'")

**URL:** <https://swi-prolog.discourse.group/t/term-string-a-a/5516>\
**Category:** Help!\
**Tags:** discussion\
**Created:** [June 18, 2022, 7:56pm UTC](https://swi-prolog.discourse.group/t/term-string-a-a/5516 "2022-06-18T19:56:56Z")\
**Posts on this page:** 1\
**Showing post:** 9

<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:** [June 19, 2022, 8:57am UTC](https://swi-prolog.discourse.group/t/term-string-a-a/5516/9 "2022-06-19T08:57:43Z")

</div>

FYI for those wondering how to track down source code when it passes from Prolog to C.

* * *

Normally to see the code behind a documented predicate just go to the SWI-Prolog documentation page and click on ![image](https://global.discourse-cdn.com/free1/uploads/swiprolog/original/2X/e/e8c92e7d74330724c8bf388349b8273868ae5993.png)

E.g.

For append/2, ![image](https://global.discourse-cdn.com/free1/uploads/swiprolog/original/2X/e/e8c92e7d74330724c8bf388349b8273868ae5993.png) links to [append/2 source code](https://www.swi-prolog.org/pldoc/doc/_SWI_/library/lists.pl?show=src#append/2)

Note: ![image](https://global.discourse-cdn.com/free1/uploads/swiprolog/original/2X/e/e8c92e7d74330724c8bf388349b8273868ae5993.png) is at the right of  
 ![image](https://global.discourse-cdn.com/free1/uploads/swiprolog/original/2X/b/b6d63c48c2bc9b0d064d30812069fbb461cc6a04.png)

* * *

However for atom\_length/2 it shows.

![image](https://global.discourse-cdn.com/free1/uploads/swiprolog/original/2X/7/71a0e909e452ede0d3aaa6f9bb2c529e6020e571.png)

So the documentation will not help at this point the source code has to be searched.

The source code is on GitHub with two repositories for SWI-Prolog

- Dev - [GitHub - SWI-Prolog/swipl-devel: SWI-Prolog Main development repository](https://github.com/SWI-Prolog/swipl-devel)
- Stable - [GitHub - SWI-Prolog/swipl: SWI-Prolog stable releases](https://github.com/SWI-Prolog/swipl)

Typically ones SWI-Prolog version is in sync with the latest SWI-Prolog development release so that repository will be used.

Browse to the [GitHub repository for SWI-Prolog development](https://github.com/SWI-Prolog/swipl-devel).  
(`https://github.com/SWI-Prolog/swipl-devel`)

In the upper left search box  
 ![image](https://global.discourse-cdn.com/free1/uploads/swiprolog/original/2X/2/2bbcd5201d8605a7b266e58b7df749edbbb46c40.png)

enter the search word: `atom_length` and press enter.

 ![image](https://global.discourse-cdn.com/free1/uploads/swiprolog/original/2X/c/c3862d6dd1fdf0fc503feb6f724c53f4a6cfcb3f.png)

On the left at the bottom click `Advanced search`

 ![image](https://global.discourse-cdn.com/free1/uploads/swiprolog/original/2X/c/c4b2b354379ce04cabd886ad7819a845b61064a3.png)

For `Written in this language` select: `C`

 ![image](https://global.discourse-cdn.com/free1/uploads/swiprolog/original/2X/0/025182f9385c0f022f6766b79c386df938d9b9b4.png)

Click `Search`

 ![image](https://global.discourse-cdn.com/free1/uploads/swiprolog/original/2X/f/fdcfe6abeccfbb3e587dd76abc988dbe8d8665cf.png)

This shows the C implementation of atom\_length/2 is in the `src` directory and `pl-prims.c` file.

* * *

* * *

A more efficient way I have found to search for such is to use Notepad++ to search a directory of local copies of GitHub repositories. A bit more details are in this [reply](https://swi-prolog.discourse.group/t/having-trouble-using-multifile-1-for-multi-file-predicates/4460/4).

---

_[View the full topic](https://swi-prolog.discourse.group/t/term-string-a-a/5516)._
