# Good behaviour in SWI-Prolog library contribution

**URL:** <https://swi-prolog.discourse.group/t/good-behaviour-in-swi-prolog-library-contribution/3596>\
**Category:** Help!\
**Created:** [February 11, 2021, 12:19pm UTC](https://swi-prolog.discourse.group/t/good-behaviour-in-swi-prolog-library-contribution/3596 "2021-02-11T12:19:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gavin.mendel.gleason](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/gavin.mendel.gleason/32/207_2.png) [@gavin.mendel.gleason](https://swi-prolog.discourse.group/u/gavin.mendel.gleason)\
**Post date:** [February 11, 2021, 12:19pm UTC](https://swi-prolog.discourse.group/t/good-behaviour-in-swi-prolog-library-contribution/3596/1 "2021-02-11T12:19:46Z")

</div>

Hello all,

I’m wondering what the appropriate way to do pull requests to SWI-Prolog. A number of elements which ship under ‘library’ are also in a pack. Should pull requests be made to the pack or to the library?

In particular I was intending to float two contributions to ‘apply’, an extended `convlist` to more arguments, and a `mapm` which is basically like `scanl` but only chaining the final argument (which is much handier for use in DCGs).

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [February 11, 2021, 12:44pm UTC](https://swi-prolog.discourse.group/t/good-behaviour-in-swi-prolog-library-contribution/3596/2 "2021-02-11T12:44:57Z")

</div>

The pack/pckage terminology is a bit shaky ☹ The core distribution consists of swipl-devel.git and git submodules that are registered under the `packages` directory (and a few more git submodules I won’t discuss now). Most of the submodules under `packages` install Prolog files in `library` in the final product.

So, you have to figure out whether it is the main git repo or some (and which) package provides a particular library file. If you built from git the build creates a directory `home` in the CMake build directory where it populates a SWI-Prolog home directory as it will ultimately be installed. This allows running `src/swipl` from the build directory without installing it, which is great for developing the system 🙂 When doing so on a system that supports symbolic links, the files in e.g., `home/library` are symlinks to the source tree. Now we see

```prolog
ls -l home/library/apply.pl 
lrwxrwxrwx 1 janw janw 25 Sep 27 10:23 home/library/apply.pl -> ../../../library/apply.pl

```

so this one comes from the main repo. We can also try this to see `time.pl` is supplied by the clib package.

```prolog
ls -l home/library/time.pl 
lrwxrwxrwx 1 janw janw 30 Sep 27 10:23 home/library/time.pl -> ../../../packages/clib/time.pl

```

See [How to submit patches?](https://www.swi-prolog.org/howto/SubmitPatch.txt) for creating a PR, notably for the submodules.
