From 615355c491210ae2fcf3ec65c894b5461f8919db Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 23 Dec 2019 23:47:12 -0800 Subject: doc: usage note for compile-update-file. * txr.1: Document how compile-update-file can be used together with load to ensure that the compiled version of a file is loaded without unnecessary recompiling. --- txr.1 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index 67ef4363..0d7f560d 100644 --- a/txr.1 +++ b/txr.1 @@ -69565,6 +69565,22 @@ if it successfully compiles, similarly to If compilation is skipped, the function returns .codn nil . +Note: the following idiom may be used to load a file, compiling it if +necessary: + +.verb + (or (compile-update-file "file") + (load-file "file")) +.brev + +However, note that it relies on the effect of compiling a source file being the +same as the effect of loading the compiled file. +This can only be true if the source file contains no +.code compile-only +or +.code eval-only +top-level forms. + .coNP Macro @ with-compilation-unit .synb .mets (with-compilation-unit << form *) -- cgit v1.2.3