From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: guile struct members are not a good 1-1 match for c structs Date: Wed, 30 Apr 2014 09:24:11 +0200 Message-ID: <87eh0fth44.fsf@pobox.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1398842675 22237 80.91.229.3 (30 Apr 2014 07:24:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Apr 2014 07:24:35 +0000 (UTC) Cc: guile-devel To: Doug Evans Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Apr 30 09:24:30 2014 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WfOsX-0005Ob-AW for guile-devel@m.gmane.org; Wed, 30 Apr 2014 09:24:29 +0200 Original-Received: from localhost ([::1]:55050 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfOsW-0008BP-Ua for guile-devel@m.gmane.org; Wed, 30 Apr 2014 03:24:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfOsP-000824-Sl for guile-devel@gnu.org; Wed, 30 Apr 2014 03:24:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WfOsK-0006Lr-NW for guile-devel@gnu.org; Wed, 30 Apr 2014 03:24:21 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:55747 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfOsK-0006Ll-If for guile-devel@gnu.org; Wed, 30 Apr 2014 03:24:16 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 2B771129AF; Wed, 30 Apr 2014 03:24:16 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=8dncb08ZFaQc2DgGkeJkqS9pbr8=; b=ZtX6EY ImYsq6dH918SxhIgLA5WHlY7gnpjXQ4HRucbl1BWvfL5HpTTMm8ul6tYWlfhmYIk NcQMaWAYcANnZzNMWgMxcs+gcvutU6gh9az/y3uFOc4HnV/5oMaVxL3T4W/YOyFw qyZWbIWYKX0Y/6wJbbL5LbpiHElBojjy6Rd9I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=FrdOREYj9oMr/M0xm9sub6G+1sx8jLWX BxYFq8QOQnHoeWPfls4cnbP96CvqfMfKHqZOReCB4Da11tjlUS9fERnYZG8s/LNm twHLUm6HdRzgjbDQ/xpXZHGs6TQHlXRZCpxwdNm7MRNZhkarIi6wRq4Lduw/WBNO NXjp5wklwmw= Original-Received: from a-pb-sasl-quonix.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 24331129AE; Wed, 30 Apr 2014 03:24:16 -0400 (EDT) Original-Received: from badger (unknown [88.160.190.192]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id F2533129AD; Wed, 30 Apr 2014 03:24:13 -0400 (EDT) In-Reply-To: (Doug Evans's message of "Tue, 29 Apr 2014 18:51:46 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-Pobox-Relay-ID: 6E75200E-D038-11E3-AD48-6F330E5B5709-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 208.72.237.25 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 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 Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:17122 Archived-At: On Wed 30 Apr 2014 03:51, Doug Evans writes: > While reading guile sources I happened across the implementation > of struct scm_print_state. ref: libguile/print.h > > It (tries to) map a C struct to a set of Guile struct fields: > ref: SCM_PRINT_STATE_LAYOUT. You know, I don't think I ever noticed that before. Gross! Structs were originally (i.e., in 1995) designed to be able to do that but it never really caught on, probably because people want structs with members that have types and might not all be the same size. BDW-GC is much better at being able to just scm_gc_malloc a memory block and then you treat it as whatever C struct type you like.... > I *could* be missing something, but I think my angst can be represented > with the following question: > > Has anyone tried to use scm_print_state from Scheme as a Guile struct > on a host with 64 bit words and 32 bit ints and 32 bit longs? I don't think anyone ever uses scm_print_state from Scheme -- from a practical matter. It's not documented anywhere. I didn't even know it was a struct. But it sure looks like it won't work at all! Andy -- http://wingolog.org/