guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gurus? Care to re-explain the absense of gh_set_x() for me?


From: Sam Tregar
Subject: Re: Gurus? Care to re-explain the absense of gh_set_x() for me?
Date: Fri, 13 Jul 2001 13:17:19 -0400 (EDT)

On 13 Jul 2001, Alex Shinn wrote:

> Hmmm... not sure what the implications of directly changing the SCM
> struct contents would be, and whether this might break things in
> Guile.

This is roughly what I was expecting the non-existent gh_set_x() to do -
change the value stored in an SCM without otherwise disturbing its
identity.

> Right, you have one Perl object with an SCM, and references would be
> references to the Perl object, not the SCM, so if the original Perl
> object binds to a new SCM, the change will be reflected in the
> references.  Or am I missing something?

That's not how it works now, but it is how it could work in the future.
The complication is that I'm using Perl's object system to track my
interface to Guile's garbage collector - I'm protecting each SCM as it's
bound to a Perl variable and unprotecting it when the Perl variable is
collected by Perl.  If I start messing with which SCM a given Perl
varibale points to I'll have to be very careful with my garbage...  Which
isn't to say it's impossible!

> I think it's pretty cool :) I just wish it were the other way around.
> Perl's Inline is best for snarfing up the libs and utilities of other
> languages, and while it would be great to have all of CPAN available
> in Guile, Guile and Scheme in general are a little anemic on the
> library side, and not much use to Perl.

Well, I am planning to provide some kind of rudimentary (perl-call)
ability to allow for callbacks into Perl.  If I eventually beefed that up
to include bindings for all of Perl's datatypes you might see something
like Inline::CPR for Inline::Guile.  This would, in a highly bizarre way,
give Guile access to all of Perl.

The biggest problem with trying to do something like that is that I'm a
Scheme newbie!  Part of my motivation in this project is to get more
familar with Scheme.  It's working, but I'm still quite a long way from
being able to competently design a complex API in Scheme.

-sam





reply via email to

[Prev in Thread] Current Thread [Next in Thread]