unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* attempt to make a transparent binding
@ 2004-12-06  6:15 Oleg A. Paraschenko
  2004-12-06 17:26 ` Stephen Compall
  0 siblings, 1 reply; 3+ messages in thread
From: Oleg A. Paraschenko @ 2004-12-06  6:15 UTC (permalink / raw)


  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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-12-08  7:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-06  6:15 attempt to make a transparent binding Oleg A. Paraschenko
2004-12-06 17:26 ` Stephen Compall
2004-12-08  7:21   ` Oleg A. Paraschenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).