8.18
top
← prev up next →

multi-file-langπŸ”— i

source code: https://github.com/AlexKnauth/multi-file-lang

A #lang language for writing multiple files as one file.
Different files are separated by #file followed by the file name. Each file is created with a path relative to the multi-file source file.
If a sub-file is not a #lang file (according to lang-file? ), multi-file does not run it, but it is still created so that other files can read from it.
For example this file:
#filea.rkt
#langracket/base
(providexf)
(definex3)
(define(fx)(string-append"hello"(make-stringx#\!)))
(f1)
#fileb.rkt
#langracket/base
(require"a.rkt")
x
(fx)
Would create the files a.rkt and b.rkt in the same directory as this file, and running this file would run both of them.
And this file:
#filea.rkt
#langracket/base
(read-line(open-input-file"data/text.txt"))
#filedata/text.txt
I'mnotcode,I'mjusttextinatextfile.
Would create the file a.rkt in the same directory as this file, and the file data/text.txt relative to this file. Running this file would only run a.rkt because data/text.txt is not a #lang file or a module file.

top
← prev up next →

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /