GNU bug report logs - #52112
Compilation of macro returning record type fails

Previous Next

Package: guile;

Reported by: Jean Abou Samra <jean <at> abou-samra.fr>

Date: Thu, 25 Nov 2021 17:52:01 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Jean Abou Samra <jean <at> abou-samra.fr>
To: 52112 <at> debbugs.gnu.org
Subject: bug#52112: Compilation of macro returning record type fails
Date: Thu, 25 Nov 2021 18:45:49 +0100
Record types are self-evaluating:

scheme@(guile-user)> (eval (make-record-type 'my-record '()) 
(current-module))
$1 = #<record-type my-record>

Yet, when a macro returns a record type, Guile fails
to byte-compile the code, even though the execution
(via the evaluator) works fine. Here is a simple example:


(define-macro (my-macro)
  (make-record-type 'my-record-2 '()))

(display (my-macro))
(newline)


Execution log:


$ guile --no-auto-compile test.scm
#<record-type my-record-2>

$ guile test.scm
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /home/jean/test.scm
;;; WARNING: compilation of /home/jean/test.scm failed:
;;; unhandled constant #<record-type my-record-2>
#<record-type my-record-2>

This is with Guile version 3.0.5.130-5a1e7.




This bug report was last modified 3 years and 200 days ago.

Previous Next


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