Skip to content

Commit

Permalink
(docs) add info about load + @​lips #354
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Mar 31, 2024
1 parent 8750bc9 commit 690feba
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ This can happen with React/Preact and when the component returns a Promise. Some
### require manual loading

You can load the SRFI with special syntax that start with `@lips`
which points to root LIPS direcotry:
which points to root LIPS directory:

```scheme
(load "@lips/lib/srfi/<number>.scm")
Expand Down
19 changes: 17 additions & 2 deletions docs/docs/lips/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -985,5 +985,20 @@ $ lips -c file.xcb
Will create `file.xcb` in same directory. For smaller files it make not have a difference when
loading `.xcb` or `.scm` files.

**NOTE**: directives `#!fold-case` and `#!no-fold-case` work only inside the parser and they are treated
as comments, so you can't compile the code that have those directives.
**NOTE**: directives `#!fold-case` and `#!no-fold-case` work only inside the parser and they are
treated as comments, so you can't compile the code that have those directives.

## loading SRFI

In LIPS, you can use `(load)` with path absolute or relative to the directory of the executed LIPS
file. But you can use special syntax that indicate the root directory of the LIPS Scheme.

```scheme
(load "@lips/lib/srfi/1.scm")
```

This will load the code from [SRFI-1](https://srfi.schemers.org/srfi-1/srfi-1.html) List
Library. You can use this syntax in Node based REPL (NPM executable). The same syntax should work
with the web. But note that the root directory reply on the path of the LIPS Scheme script file. So
you if you bundle the code with Webpack or Rollup, LIPS may not find the root URL and may not be
able to load the proper file.
2 changes: 1 addition & 1 deletion templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ This can happen with React/Preact and when the component returns a Promise. Some
### require manual loading

You can load the SRFI with special syntax that start with `@lips`
which points to root LIPS direcotry:
which points to root LIPS directory:

```scheme
(load "@lips/lib/srfi/<number>.scm")
Expand Down

0 comments on commit 690feba

Please sign in to comment.