From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Marius Vollmer Newsgroups: gmane.lisp.guile.devel Subject: Re: records as s-expressions Date: Thu, 16 Oct 2003 22:48:26 +0200 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87ad80rjs5.fsf@zagadka.ping.de> References: <87llrxcan4.fsf@zagadka.ping.de> <87fzhtq87a.fsf@zagadka.ping.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1066337425 12143 80.91.224.253 (16 Oct 2003 20:50:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 16 Oct 2003 20:50:25 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Oct 16 22:50:23 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AAF4g-0001Qp-00 for ; Thu, 16 Oct 2003 22:50:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AAF3k-0008AM-K9 for guile-devel@m.gmane.org; Thu, 16 Oct 2003 16:49:24 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AAF3M-00083r-St for guile-devel@gnu.org; Thu, 16 Oct 2003 16:49:00 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AAF2q-0007xl-MC for guile-devel@gnu.org; Thu, 16 Oct 2003 16:48:59 -0400 Original-Received: from [195.253.8.218] (helo=mail.dokom.net) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AAF2q-0007xi-BH for guile-devel@gnu.org; Thu, 16 Oct 2003 16:48:28 -0400 Original-Received: from dialin.speedway15.dip217.dokom.de ([195.253.15.217] helo=zagadka.ping.de) by mail.dokom.net with smtp (Exim 3.36 #3) id 1AAF54-0001I4-00 for guile-devel@gnu.org; Thu, 16 Oct 2003 22:50:46 +0200 Original-Received: (qmail 2996 invoked by uid 1000); 16 Oct 2003 20:48:26 -0000 Original-To: Thamer Al-Harbash In-Reply-To: (Thamer Al-Harbash's message of "Thu, 16 Oct 2003 15:59:21 -0400 (EDT)") User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2885 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2885 Thamer Al-Harbash writes: > On Thu, 16 Oct 2003, Marius Vollmer wrote: > >> Yes. >> >> One other thing that just occured to me: how does 'read' find the >> record creator from the type name? > > Good point. I can't see how this would work by putting it in the > reader. Me neither. We can't easily solve the general problem (writing _all_ record types in a readable way by default), but we could make it easy for the user to implement readable writing for selected record types. Something like this: (define r (make-record-type foo '(a b) readable-record-printer)) (register-record-reader 'foo foo) where readable-record-printer will print a record as #,(foo a: ... b: ...) and register-record-reader will use define-reader-ctor to be able to read the record back in. > Here's the real problem though: That's not serious: this only happens because the default record printer uses display instead of write. > However a problem occurs when dealing with SMOBs or types which > (read) cannot convert properly. How is this dealt with in data > types like arrays? If I print an array, which contains smobs or > records, from the REPL, how is it converted back when (read) gets it > again? This is a separate problem; we don't need to solve it right now. -- GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405 _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel