From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Lam Newsgroups: gmane.lisp.guile.user Subject: Re: srfi-9 vs make-record-type Date: Mon, 13 Jul 2020 13:07:23 +0000 Message-ID: References: <87lfw78ohy.fsf@netris.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29109"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-user Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Mon Jul 13 15:08:09 2020 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1juyBk-0007Sn-IA for guile-user@m.gmane-mx.org; Mon, 13 Jul 2020 15:08:08 +0200 Original-Received: from localhost ([::1]:42828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1juyBj-0001f1-JQ for guile-user@m.gmane-mx.org; Mon, 13 Jul 2020 09:08:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1juyBX-0001dC-4C for guile-user@gnu.org; Mon, 13 Jul 2020 09:07:55 -0400 Original-Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]:39365) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1juyBV-0005iV-AI for guile-user@gnu.org; Mon, 13 Jul 2020 09:07:54 -0400 Original-Received: by mail-ed1-x529.google.com with SMTP id d18so13602253edv.6 for ; Mon, 13 Jul 2020 06:07:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:cc; bh=B6hT89lpTA7v5f8ltSZ/h4LZy38gWsWMtFxLhzsYg70=; b=dBl5YQPM2UvxEem5WTt189xMGJM2vydaQSJjeTwbi1IxZz66P+SJhKE/tUWV2/jC5D AbrdRI0ZY5a3yA59zws9+JEVQp4xISe2HEC4+h+ZPPyjcyQmY45dwb29SnXKsHGbp2+w SUZfMhuKnaUA5mf4BYHmUbFPu8qtW6vEyuU9AeGXAu7ReeTUBneqvP0nAdw91tLKRXRk qyzqWhpbvApnQidVM16li9hZ47AhNWMZo9GeKa63aJfX9LXdu4U6YZF44xws/j07hbKh 8fWvSoQ6X73D/qBSo7FH8hihFwhXH+hfytlyaS8eKzb2hiLbkxzuj6jqfzZU5WVTjnMr vdCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:cc; bh=B6hT89lpTA7v5f8ltSZ/h4LZy38gWsWMtFxLhzsYg70=; b=iPZ3Qv7nt8nLg0JLbnvMs044EkFrBOvVtTOk58RD86XjLFaxGKuPWolP2Pc7BJAE5t fLBDHGFFDKo/0zb9VcURsKXfPyIb4eLQfeDHCECk4l2zbnkE5HQeOxQ9kdy9x7FSR909 q6glRa6fDglCZMVOqP8Z4XAKIeCQrqf3YgJDAYQCyHRf6jWa/E7tmQunhyiAI24lc6Vc J2DT++ngzUk7lH04DTVQS1GmwbMQ25sWAl9dhqj/JbcC93pC9RjLDj70Yl7f/rs6jesh Qi1gn/6k9MyiSg2HAsmiD62e41wq8SIplg9dT6Y5I4ob+tVVV8QvkPQ/xI1CBseJ085W vYxg== X-Gm-Message-State: AOAM531dpT7WUjb6ZOz0s2pjB6zsNZqVMbJJalvQjEkyrcMgCw1j3SNV oDNVxeDJ65QfUCSGTNcHECSppDI48c3468Mwa2xrX17D X-Google-Smtp-Source: ABdhPJyTtG85c/T1oq50YUKLVb814KvLyNRC4MoDFuLLZoBhsk8XiVrU580X9XNH/I8echqRaTQPm7urYyZUNePTQ4I= X-Received: by 2002:a05:6402:b72:: with SMTP id cb18mr52137360edb.352.1594645670587; Mon, 13 Jul 2020 06:07:50 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=christopher.lck@gmail.com; helo=mail-ed1-x529.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.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, HTML_MESSAGE=0.001, MALFORMED_FREEMAIL=1, MISSING_HEADERS=1.021, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:16678 Archived-At: Followup. As part of preparation for compatibility with guile-3, we've changed gnucash's use of make-record-type to define-record-type. Since the record field getters and setters are not exportable across modules, we've used the following forms. (define-record-type :record (make-record field1 field2) record? (field1 field1-getter field1-setter) (field2 field2-getter field2-setter)) (define-public gnc:field1-getter field1-getter) (define-public gnc:field1-setter field1-setter) (define-public gnc:field2-getter field2-getter) (define-public gnc:field2-setter field2-setter) There may be a more elegant solution but for now it'll do. See the set of related commits at https://github.com/Gnucash/gnucash/commits?after=00bbd32677fba00ae0e709dce0bb35e06f90305c+4 onwards. On Mon, 26 Aug 2019 at 12:20, Christopher Lam wrote: > Thank you Mark and John. > > On Mon, 5 Aug 2019 at 18:18, Mark H Weaver 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 ;-) >