From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Oleg A. Paraschenko" Newsgroups: gmane.lisp.guile.user Subject: attempt to make a transparent binding Date: Mon, 6 Dec 2004 09:15:37 +0300 Organization: DataHansa Message-ID: <20041206091537.78f37dc9.olpa@datahansa.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1102313573 23914 80.91.229.6 (6 Dec 2004 06:12:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 6 Dec 2004 06:12:53 +0000 (UTC) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Dec 06 07:12:50 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CbC77-0005Sr-00 for ; Mon, 06 Dec 2004 07:12:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CbCGr-0000e8-3V for guile-user@m.gmane.org; Mon, 06 Dec 2004 01:22:53 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CbCGo-0000e1-39 for guile-user@gnu.org; Mon, 06 Dec 2004 01:22:50 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CbCGn-0000dh-M6 for guile-user@gnu.org; Mon, 06 Dec 2004 01:22:49 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CbCGn-0000de-JJ for guile-user@gnu.org; Mon, 06 Dec 2004 01:22:49 -0500 Original-Received: from [212.227.126.188] (helo=moutng.kundenserver.de) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CbC72-0004KK-Jt for guile-user@gnu.org; Mon, 06 Dec 2004 01:12:44 -0500 Original-Received: from [212.227.126.209] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1CbC71-0000of-00 for guile-user@gnu.org; Mon, 06 Dec 2004 07:12:43 +0100 Original-Received: from [195.19.253.199] (helo=prof) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1CbC71-0003E5-00 for guile-user@gnu.org; Mon, 06 Dec 2004 07:12:43 +0100 Original-To: guile-user@gnu.org X-Mailer: Sylpheed version 0.9.6 (GTK+ 1.2.10; i586-alt-linux-gnu) X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:2dff3eb4b65e4eab72c798080828ddda X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:3823 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:3823 Hello, I'm making a binding to a C program. One of the memory structures in the program is a list which can contain sublists and strings. I'd like to present this structure as the Scheme list in Guile, so the usual list functions like 'car', 'cdr', 'for-each' etc would work. A trivial approach is to write a function (let name it "memory->list") which creates a real Scheme list from the data. But I wonder if it is possible to complicate things. First, the data in memory are big enough, and full instantiation of lists wastes resources, especially because I use only small part of the data. Instead, I'd like to have lazy instantiation. Let "memory->list" returns a special type of pair in which car and cdr are instantiated on demand. Is it possible? The second. Having Scheme data, I'd like to get the origin of this data in the C program. Currently I think about mapping from SCMs to C structures in C-Guile glue, but I'm afraid this is bad for garbage collection. I'd be thankful for your comments and suggestions. Regards, Oleg _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user