From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 98676 invoked by alias); 1 Jan 2019 20:05:31 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 98665 invoked by uid 89); 1 Jan 2019 20:05:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:639, HContent-Transfer-Encoding:8bit X-HELO: aibo.runbox.com Received: from aibo.runbox.com (HELO aibo.runbox.com) (91.220.196.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 01 Jan 2019 20:05:28 +0000 Received: from [10.9.9.212] (helo=mailfront12.runbox.com) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1geQI0-0004QY-V8; Tue, 01 Jan 2019 21:05:25 +0100 Received: by mailfront12.runbox.com with esmtpsa (uid:757155 ) (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) id 1geQHy-0003QJ-Tl; Tue, 01 Jan 2019 21:05:23 +0100 Subject: Re: Pretty-printing records From: Per Bothner To: Duncan Mak , kawa mailing list References: Message-ID: <6d13d508-1739-191f-5c40-2a8b24be264f@bothner.com> Date: Tue, 01 Jan 2019 20:05:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2019-q1/txt/msg00005.txt.bz2 On 12/31/18 7:32 PM, Per Bothner wrote: > Something similar could be done for SRFI-9 records, but it might take some changes > in how they are implemented, to better support introspection.  Using Java > reflection is possible, though maybe expensive. It turned out to be relatively simple to change SRFI-9 records so they extend kawa.lang.Record. This fixes printing of the resulting records. This doesn't accomplish pretty-printing, but that should also be fairly simple. Probably best by having kawa.lang.Record implement gnu.kawa.format.Printable. -- --Per Bothner per@bothner.com http://per.bothner.com/