Subject: bug#52112: Compilation of macro returning record type fails

From: Jean Abou Samra <[email-masked]>
Date: Fri, 26 Nov 2021 20:02:39 +0100

Thanks for your reply.

Le 26/11/2021 à 19:54, Taylan Kammer a écrit :
> I don't think that's supposed to work.  I find it surprising that
> record-type objects are self-evaluating, and in any case they can't
> be turned into bytecode.
>
> Your macro could return code that evaluates to a record definition.
> Would that solve your use-case?

Yes, that is how I solved it in LilyPond
(https://gitlab.com/lilypond/lilypond/-/merge_requests/1026).

I was also somewhat surprised to see that
record types are self-evaluating. I don't
know where to check in R6RS what the expected
behavior would be. At any rate, it seems that
there is an inconsistency between the interpreter
and the compiler that would warrant resolving
either way.