[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: srfi-9 vs make-record-type
From: |
Christopher Lam |
Subject: |
Re: srfi-9 vs make-record-type |
Date: |
Mon, 26 Aug 2019 12:20:57 +0000 |
Thank you Mark and John.
On Mon, 5 Aug 2019 at 18:18, Mark H Weaver <address@hidden> wrote:
> The problem here is that 'make-person' is a macro. Macros are expanded
> at compile time, and must therefore be available at compile time.
>
> When you compile 'm2.scm', those macros are not available, because
> 'load' only has effects at run-time, by design. Since there is no macro
> definition for 'make-person' at compile-time, Guile's compiler generates
> code that assumes it will be a procedure.
>
> In summary, you cannot use 'load' to import macros from another module.
>
> > For various reasons I must keep (load "module.scm") mechanism
> If you can share those reasons, perhaps I can help you find another
> solution.
>
The only reason is that I've started cleaning up numerous modules in
GnuCash written about 20 years ago, and the hyper-modular approach is too
difficult to try unravel for now. So, I've converted records to srfi-9
wherever possible (i.e. used internally), and left the exported ones alone.
This one was a fun one to fix:
https://github.com/Gnucash/gnucash/commit/e3a695d0 ;-)