GNU bug report logs - #71301
[PATCH] module: Add some docstrings to (system base compile).

Previous Next

Package: guile;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Sat, 1 Jun 2024 02:21:01 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 71301 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#71301; Package guile. (Sat, 01 Jun 2024 02:21:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Sat, 01 Jun 2024 02:21:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: bug-guile <at> gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH] module: Add some docstrings to (system base compile).
Date: Fri, 31 May 2024 22:19:39 -0400
* 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 f7e82404e..2468d1dab 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: 779a83d9c682345802f9a605cb8e2b4892129316
-- 
2.41.0





This bug report was last modified 175 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.