[Top][All Lists]
[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: |
Alex Shinn |
Subject: |
Re: Gurus? Care to re-explain the absense of gh_set_x() for me? |
Date: |
13 Jul 2001 11:29:11 -0400 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.103 |
>>>>> "Sam" == Sam Tregar <address@hidden> writes:
Sam> On Fri, 13 Jul 2001, Thien-Thi Nguyen wrote:
>> what's wrong w/:
>>
>> SCM a; a = scm_sum (a, SCM_INUM (10));
Sam> If something was pointing to a before the += then it is no
Sam> longer pointing to a since scm_sum will return a new SCM.
Sam> Consider a globally bound variable or an item in a list.
If what was pointing to a? In Perl, you probably just want to point
to the same Perl value, which contains an SCM. Mutating functions
would then just bind this to a new SCM.
The trick seems to be that you want for a Perl variable to stand for a
Guile variable, and have changes in Perl be reflected in Guile. But
numbers in Guile are immutable, so even if you had:
(define foo 5)
(define bar foo)
(+= bar 1)
bar would be 6, but foo would still be 5. So Perl can work with
SCM's, and if you want Perl can define/set values in Guile, but you're
probably trying to do the wrong thing if you want
$foo += 1;
in Perl to modify an existing Scheme variable.
--
Alex Shinn <address@hidden>
http://synthcode.com/
- Re: No gh_set_x()?, (continued)
- Re: No gh_set_x()?, Sam Tregar, 2001/07/10
- Re: No gh_set_x()?, Brett Viren, 2001/07/10
- Re: No gh_set_x()?, Sam Tregar, 2001/07/10
- Gurus? Care to re-explain the absense of gh_set_x() for me?, Sam Tregar, 2001/07/12
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Martin Grabmueller, 2001/07/13
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Sam Tregar, 2001/07/13
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Martin Grabmueller, 2001/07/13
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Sam Tregar, 2001/07/13
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Thien-Thi Nguyen, 2001/07/13
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Sam Tregar, 2001/07/13
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?,
Alex Shinn <=
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Sam Tregar, 2001/07/13
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Alex Shinn, 2001/07/13
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Sam Tregar, 2001/07/13
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Eric E Moore, 2001/07/13
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Rob Browning, 2001/07/13
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Miroslav Silovic, 2001/07/15
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Rob Browning, 2001/07/16
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Neil Jerram, 2001/07/14
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Miroslav Silovic, 2001/07/15
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Neil Jerram, 2001/07/16