From unknown Sat Jun 14 05:32:29 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71301: [PATCH] module: Add some docstrings to (system base compile). Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 01 Jun 2024 02:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 71301 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch To: 71301@debbugs.gnu.org Cc: Maxim Cournoyer X-Debbugs-Original-To: bug-guile@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17172084111082 (code B ref -1); Sat, 01 Jun 2024 02:21:01 +0000 Received: (at submit) by debbugs.gnu.org; 1 Jun 2024 02:20:11 +0000 Received: from localhost ([127.0.0.1]:55568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sDELr-0000HN-67 for submit@debbugs.gnu.org; Fri, 31 May 2024 22:20:11 -0400 Received: from lists.gnu.org ([209.51.188.17]:43802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sDELp-0000HF-LE for submit@debbugs.gnu.org; Fri, 31 May 2024 22:20:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sDELd-0006WX-0N for bug-guile@gnu.org; Fri, 31 May 2024 22:19:57 -0400 Received: from mail-qv1-xf2a.google.com ([2607:f8b0:4864:20::f2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sDELb-0004F2-GC for bug-guile@gnu.org; Fri, 31 May 2024 22:19:56 -0400 Received: by mail-qv1-xf2a.google.com with SMTP id 6a1803df08f44-6ae1b32752fso12089776d6.0 for ; Fri, 31 May 2024 19:19:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717208393; x=1717813193; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=2W6sQ+m6mv1Vr9y436Nod1eyiULO9wQGj5Z1lYc8yF4=; b=P7bnJyFfL4P4jFahdNjBS84+2KVNb6Ncn2UaCPfpgmhF+S16fHtLzAM1GnQZhPuyok vBN2peIRffLokTYjXabDhdEQZBf/SxV/wf4m2WS+JRlLp3MtnvPOula1ZAEXqoR0u+FZ S6JulbM53MHqK0HIfc75LB+Z4fJ3BPt/hCop4r9OXE+V2VmetXTkG/suDxu/VUP9dZUn IA+n50IRD4a/81ALCsB+l+9iQbmbzxbQ84qxNO7s12I0jWH8nmpO5LNBhA6P/jUCySWu 7ooE9+T19bZatZ/jXjojO5lLrXte+zTNkSHlvmfze/6iXdNBNYkLAdKWEsmGCPNG5VB7 vPOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717208393; x=1717813193; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2W6sQ+m6mv1Vr9y436Nod1eyiULO9wQGj5Z1lYc8yF4=; b=WGcg3Vf0UgoQxDxWkSEnbTHgU2ZxMevLylB8Mszv52Y/752ozAbhRfHHsh2/ASug5i MJ7f3HV4/pUY77M/rxKPmhchHZeZty6amFsJZO3iMupGJIkzU9TSAaZBYPPbBGohic7I 4zYowUX2yfn2vQdYsw939iROLn1XvyNbhSS9pNPsOGHZTH8F1dYCRVxHSUg3Gl+MI+SA +895ABi3dL2RhpYJf2PyieL7TaYGYi6F6XzCUqHrdOnDw0gO5JicRKQkQClW6dYdTW5n SqDbTRTOnwsLnSjJAMAZrEs9Rm+Q9hRmI8IJ/nDl5RVj/KazdgqXj+0bCIdH6Sx3Q020 xfGw== X-Gm-Message-State: AOJu0Yw8EHoJiK0uIijHJLSplSoGNZJgxQAJNjJ32VpKHGrLtcBHqRSI B2slA73qSBYHvK1UTHZmvsd8lfRIqRokgteLcyO/zYWq5wsbSCOVBCx4Qw== X-Google-Smtp-Source: AGHT+IG3p7NCtTRxh3FQQ0WYXykuU8RsC2Okmbj//LBC6Zu/Gz+Hqp4YPKy+AXzcvUM3VOnvQ+GJ3Q== X-Received: by 2002:a05:6214:5349:b0:6ab:8868:5186 with SMTP id 6a1803df08f44-6aecd59865emr39370246d6.2.1717208392983; Fri, 31 May 2024 19:19:52 -0700 (PDT) Received: from localhost.localdomain (dsl-205-233-124-92.b2b2c.ca. [205.233.124.92]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ae4a73e54dsm11268796d6.2.2024.05.31.19.19.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 19:19:52 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 31 May 2024 22:19:39 -0400 Message-ID: <20240601021945.1547-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::f2a; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qv1-xf2a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) * 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