|
From: | Al |
Subject: | compile-time deserialization |
Date: | Tue, 26 Dec 2023 22:07:23 +0200 |
User-agent: | Mozilla Thunderbird |
However, such deserialization happens at run-time. If I compile my program into an executable, it will try to open "file.txt" at run-time. How can I arrange for "file.txt" to be read at compile-time, and inlined into the executable, so that the executable doesn't require access to the original file?
The only way I can think of is to convert "file.txt" to a scheme string definition in a separate file:
; file.scm (define file-contents " ... ")and include it via (include "file.scm"). Then the definition would occur at compile-time.
But of course this requires encoding (possibly binary) files as scheme strings, and probably an extra Makefile step to convert file.txt into file.scm. This is not attractive -- are there other options?
[Prev in Thread] | Current Thread | [Next in Thread] |