8000 Adding directories to load path · Issue #2355 · raviqqe/stak · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Adding directories to load path #2355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Retropikzel opened this issue Apr 17, 2025 · 1 comment
Open

Adding directories to load path #2355

Retropikzel opened this issue Apr 17, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@Retropikzel
Copy link

I tried looking around the documentation and code but could not find a way to add directory to library load path.
Is there one?

Example:

snow/foo/bar.sld:
(define-library (foo bar) (import (scheme base) (scheme write)) (export (baz)) (include "bar.scm"))

snow/foo/bar.scm:
(define baz (lambda () (display "Hello world") (newline)))

main.scm:
(import (scheme base) (foo bar)) (baz)

I dont think the library naming directory structure link is in R7RS but most implementations support it.

If there is no flag for this may I suggest -I and -A from SRFI-138?

Then running code above would be something like this:
stak -I ./snow main.scm

@raviqqe
Copy link
Owner
raviqqe commented Apr 18, 2025

Thank you for reporting your suggestions! I think it's great to support SRFI-138 as it is although Stak Scheme has several features to be implemented before that.

Stak Scheme currently doesn't support the define-library form in the direct Scheme interpreter but only in the compiler + bytecode interpreter mode as Stak Scheme is originally developed as more like a embedded scripting language. So that's one task to be done before the load path stuff.

Another thing is the include directive in your example which is relatively easy to implement in the direct interpreter as I can just read a file into S-expressions in the eval procedure.

I've just added issues for these features:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

2 participants
0