guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] module: Add some docstrings to (system base compile).


From: Maxim Cournoyer
Subject: [PATCH] module: Add some docstrings to (system base compile).
Date: Thu, 9 Nov 2023 22:45:11 -0500

* module/system/base/compile.scm (next-pass): Add doc.
(compute-compiler, read-and-compile, compile): Likewise.
---

 module/system/base/compile.scm | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/module/system/base/compile.scm b/module/system/base/compile.scm
index a33d012bd..f5915401e 100644
--- a/module/system/base/compile.scm
+++ b/module/system/base/compile.scm
@@ -232,6 +232,9 @@
     (proc (proc optimization-level opts))))
 
 (define (next-pass from lang to optimization-level opts)
+  "Return a pair containing the next target language name and its
+associated compilation procedure (pass) required to compile LANG from
+FROM to TO."
   (if (eq? lang to)
       #f ;; Done.
       (match (language-compilers lang)
@@ -248,6 +251,11 @@
               (cons (lookup-language name) pass))))))))
 
 (define (compute-compiler from to optimization-level warning-level opts)
+  "Return a procedure accepting an EXP and ENV arguments that lookup and
+invoke the necessary compiler(s) to compile EXP from FROM to TO.  The
+returned procedure returns the compiled expression (exp), the
+environment (env) as well as a continuation environment (cenv) as
+multiple values."
   (let ((from (ensure-language from))
         (to (ensure-language to)))
     (let lp ((lang from))
@@ -302,6 +310,8 @@
                            (optimization-level (default-optimization-level))
                            (warning-level (default-warning-level))
                            (opts '()))
+  "Return the compiled bytevector (or the format of the chosen TO target
+language) of the source read from PORT."
   (let* ((from (ensure-language from))
          (to (ensure-language to))
          (joint (find-language-joint from to optimization-level opts)))
@@ -346,6 +356,7 @@
                   (optimization-level (default-optimization-level))
                   (warning-level (default-warning-level))
                   (opts '()))
+  "Return the compiled bytecode of X, an expression."
   (validate-options opts)
   (let ((compile1 (compute-compiler from to optimization-level
                                     warning-level opts)))

base-commit: 75cd95060fb1ea7586f0e4b9081694c6d61f1d3b
-- 
2.41.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]