diff --git a/doc/.vuepress/config.js b/doc/.vuepress/config.js index f0ad75af1..da17864b2 100644 --- a/doc/.vuepress/config.js +++ b/doc/.vuepress/config.js @@ -14,7 +14,7 @@ module.exports = { '/guide/': [ { title: 'Guide', - children: ['', 'intro', 'getting-started', 'ffi', 'emacs', 'shell', 'env-vars', 'package-manager', 'docker', 'macos', 'nix', 'r7rs'] + children: ['', 'intro', 'getting-started', 'ffi', 'emacs', 'shell', 'env-vars', 'package-manager', 'docker', 'macos', 'nix', 'r7rs', 'hacking-on-the-stdlib'] } ], '/tutorials/': [ diff --git a/doc/guide/hacking-on-the-stdlib.md b/doc/guide/hacking-on-the-stdlib.md new file mode 100644 index 000000000..4f2c9ca7b --- /dev/null +++ b/doc/guide/hacking-on-the-stdlib.md @@ -0,0 +1,33 @@ +# Hacking on the Standard Library + +Gerbil is a growing project and your contributions are welcome! + +When working on modifications to the standard library, it's common to encounter errors +such as: + +``` +*** ERROR IN gx#core-expand-import%__% -- +*** ERROR IN "file.ss"@1.9 +--- Syntax Error: Cannot find library module +... form: :std/my/module +``` +This typically because the `gxi` or `gxc` being used is looking at the installed +standard library which will not contain your changes. To address this, run your +environment with the `build.sh` script after building. + +Example build: + +```shell +./build.sh +``` + +To test your local changes rebuild the stdlib and then use the locally built `gxi` with +the following commands: + +```shell +./build.sh stdlib +./build.sh env gxi ../your-test-file.ss +``` +**NOTE:** the execution environment when using `./build.sh env` is in the `src/` folder +in the root of the Gerbil repo. Absolute paths work as normal, but relative paths must +be adjusted for `PWD` change.