From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: John Cowan Newsgroups: gmane.lisp.guile.user Subject: Re: srfi-9 vs make-record-type Date: Sun, 21 Jul 2019 15:21:14 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="218219"; mail-complaints-to="usenet@blaine.gmane.org" Cc: guile-user To: Christopher Lam Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Jul 21 21:21:40 2019 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hpHOt-000uf4-QS for guile-user@m.gmane.org; Sun, 21 Jul 2019 21:21:39 +0200 Original-Received: from localhost ([::1]:57470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hpHOs-0000ut-Kw for guile-user@m.gmane.org; Sun, 21 Jul 2019 15:21:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53088) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hpHOm-0000ua-75 for guile-user@gnu.org; Sun, 21 Jul 2019 15:21:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hpHOl-0007YF-42 for guile-user@gnu.org; Sun, 21 Jul 2019 15:21:32 -0400 Original-Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:34241) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hpHOk-0007Vx-NX for guile-user@gnu.org; Sun, 21 Jul 2019 15:21:31 -0400 Original-Received: by mail-wr1-x42b.google.com with SMTP id 31so37178255wrm.1 for ; Sun, 21 Jul 2019 12:21:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccil-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hV7vZWgVFe8RZTOEr5g0yCef7bmwkMlTzQiw6BKAldg=; b=yce3TdJm4NoPScUK8NZrI2atz3To8jIHnbX/SL1CmPUkpfOxLUeYIRlfJcoFZjtzNa KxvfvM1ejJ4SN8JoSqXpZkaWrjymY8sZl9sFjtZqA/CDH3gt8cOghn+OsjxxOyAMkKqH 6tf2B/T0UjtXEIrQeBPxEq1jUJJkwzKKCZLWNzVxwZPfs4ZfdKb2OYEXxkxoqqNgZ7wv FE2Xo7QB5tRYsc5JtmYa0ZdFTCM84zBywpdovxi1w7QvqqSAxKPd81bws933ECegHzac VzV1jsBcAEaNDdGMKiduMRZ7MMHUjj4CZU5fTx8dNIpaaN7nrvwCOFGcwAnnxqFnjOHu iMZg== 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:to:cc; bh=hV7vZWgVFe8RZTOEr5g0yCef7bmwkMlTzQiw6BKAldg=; b=ogy4J8+zXvCHkDys36vkqbI+qR+e8Y+vkxilEetKBM2by75ul+SJERF1rQNzIDyAqv CqwWvUjNjXVlmD3fo5CJIcaS1h3rdijKhqWq5jiUCjmIfMP0LiOVwqOU6XWEe8MYT7M+ wB0HY+0X+3NDZQ+qNDJXM2s3fwrLTaf0m264YEw+imcmzvFhAwZy9GKvAG84hwYS8G3h T67SnYRL6aH03FdCOoMNEjuk9uBY1ctCQd8VTbeRJqKIbdfpUwnQv3jkbIPKa6+T/K2A V2o2AalpY/Orcb+b7sEgv/Vbw2sTWYIVCzQknxnmtBQTj7APGBXq0n9WpSoiE+KrzlI0 5T+Q== X-Gm-Message-State: APjAAAWL1QG/zP1F5CytGCmYWgK7VM0uFvMUt1wor1zSL6xAFioRR7D7 fprlHkSLg+ZXmZSE1h+G+K1vU7r3V4WsggfXN224KQ== X-Google-Smtp-Source: APXvYqzcnTV5PSq+1DbmnB94CwTtW4huP5kmfpJekQWhI6kvEbAa7ypUrHzgeGA0y6uVWjBCcYjfARYTfV+AgYL2b0A= X-Received: by 2002:adf:c508:: with SMTP id q8mr69298052wrf.148.1563736888522; Sun, 21 Jul 2019 12:21:28 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42b 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.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:15658 Archived-At: On Sun, Jul 21, 2019 at 6:21 AM Christopher Lam wrote In experiments converting legacy code to use srfi-9 records, I'm finding > the latter doesn't travel well across modules. > In SRFI 9 you need to define a record type in exactly one module and then export whatever subset of the constructor, predicate, accessors, and mutators (not typically the record type name) that you want to make visible. Other modules can then import those names. This is because calls on define-record-type are generative (SRFI 9 doesn't say so, but in practice they are), so a particular record type should be defined only once. In my code, I often export the predicate and accessors, but not the constructor or mutators. Then I export a factory method that may or may not call the constructor. It may be convenient to define the record-type in its own module. John Cowan http://vrici.lojban.org/~cowan cowan@ccil.org Promises become binding when there is a meeting of the minds and consideration is exchanged. So it was at King's Bench in common law England; so it was under the common law in the American colonies; so it was through more than two centuries of jurisprudence in this country; and so it is today. --Specht v. Netscape