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: Martin Grabmueller
Subject: Re: Gurus? Care to re-explain the absense of gh_set_x() for me?
Date: Fri, 13 Jul 2001 12:51:10 +0200 (MEST)

> From: Sam Tregar <address@hidden>
> Date: Fri, 13 Jul 2001 02:01:43 -0400 (EDT)
> 
> Simple put, how can I implement this call in C:
> 
>    (+= a 10)
> 
> My attempt was something like this in C:
> 
>    (set! a (+ a 10))
> 
> But since there's no (gh|scm)_set_x in Guile, I'm stuck.

There is of course a way, Guile is doing all the time.  Problem is, I
don't think you want to know.

If you want to support Scheme properly, there will be no way around
making a difference between global and local variables.  And for
handling local variables, you will need to support nested
environments.  When you have these environments, you can get your
hands on the local variables and modify then.  Read libguile/eval.c if
you dare :)

'martin



reply via email to

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