Skip to content

Commit 690feba

Browse files
committed
(docs) add info about load + @​lips jcubic#354
1 parent 8750bc9 commit 690feba

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ This can happen with React/Preact and when the component returns a Promise. Some
264264
### require manual loading
265265

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

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

docs/docs/lips/intro.md

+17-2
Original file line numberDiff line numberDiff line change
@@ -985,5 +985,20 @@ $ lips -c file.xcb
985985
Will create `file.xcb` in same directory. For smaller files it make not have a difference when
986986
loading `.xcb` or `.scm` files.
987987

988-
**NOTE**: directives `#!fold-case` and `#!no-fold-case` work only inside the parser and they are treated
989-
as comments, so you can't compile the code that have those directives.
988+
**NOTE**: directives `#!fold-case` and `#!no-fold-case` work only inside the parser and they are
989+
treated as comments, so you can't compile the code that have those directives.
990+
991+
## loading SRFI
992+
993+
In LIPS, you can use `(load)` with path absolute or relative to the directory of the executed LIPS
994+
file. But you can use special syntax that indicate the root directory of the LIPS Scheme.
995+
996+
```scheme
997+
(load "@lips/lib/srfi/1.scm")
998+
```
999+
1000+
This will load the code from [SRFI-1](https://srfi.schemers.org/srfi-1/srfi-1.html) List
1001+
Library. You can use this syntax in Node based REPL (NPM executable). The same syntax should work
1002+
with the web. But note that the root directory reply on the path of the LIPS Scheme script file. So
1003+
you if you bundle the code with Webpack or Rollup, LIPS may not find the root URL and may not be
1004+
able to load the proper file.

templates/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ This can happen with React/Preact and when the component returns a Promise. Some
264264
### require manual loading
265265

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

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

0 commit comments

Comments
 (0)