guile-user
[Top][All Lists]
Advanced

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

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


From: Sam Tregar
Subject: Gurus? Care to re-explain the absense of gh_set_x() for me?
Date: Thu, 12 Jul 2001 20:12:02 -0400 (EDT)

Anyone?

On Tue, 10 Jul 2001, Sam Tregar wrote:

> On Tue, 10 Jul 2001, Brett Viren wrote:
>
> > I guess to get the equiv of set! you need to check if the symbol
> > exists before using gh_define().  But, I am no expert.  Below is the
> > reply I got when I asked this.  Hope it helps.
>
> Ok, I'll respond to that below.  Maybe the original answerer can shed more
> light on the subject.
>
> >  > `set!' is not a procedure.  it's an "overloaded" syntax for two
> >  > different things:
> >  >
> >  > * changing the binding of a lexical variable.  this is impossible to
> >  >   express in C.
>
> Um, why not?  It seems to me that given an SCM I should be able to set it
> to the value given by another SCM and have that new value reflected
> through whatever was pointing the the first SCM.
>
> Perhaps there's a better way to ask for what I need - how would you
> implement a "+=" procedure in C?  It takes two arguments, adds them and
> modifies the initial argument to contain the result:
>
> >  > * changing the binding of a top-level variable.  this would be
> >  >   possible to do if the concept of a top-level variable (or a module)
> >  >   was somehow exported in the gh_ interface, but it is not.
> >  >
> >  > so I guess that you want to achieve the effect of `set!'ing a
> >  > top-level variable.  `gh_define' should do the trick, I believe.
>
> Hm, ok.  The problem here is that by the time I get to the point where I'm
> trying to call the non-existent gh_set_x() all I have is a single SCM.
> How can I know if it's bound at the top-level or not?
>
> -sam
>
>
>
> _______________________________________________
> Guile-user mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/guile-user
>




reply via email to

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