"#define" constants as methods
Klaus Malorny
Klaus.Malorny at knipp.de
Fri Apr 5 07:15:11 UTC 2024
On 04.04.24 20:38, Jorn Vernee wrote:
> Hello,
>
> For string constants we have to allocate and copy memory, so we defer
> the initialization of those. For that to work, at least string constants
> need to be exposed as methods. Historically we had a different
> translation strategy for constants that also required them to be exposed
> as methods, and I think we kept the methods for all types of constants
> mostly out of consistency.
>
> [...]
> Jorn
>
Hi Jorn,
thanks for the explanation. This makes sense. API consistency is surely
a valid and valuable argument and my "switch" problem is surely a rather
seldom one. I did not realize that (complex) constants will be
represented in their C-style form.
Regards,
Klaus
More information about the jextract-dev
mailing list