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: Miroslav Silovic
Subject: Re: Gurus? Care to re-explain the absense of gh_set_x() for me?
Date: 16 Jul 2001 00:01:47 +0200

Sam Tregar <address@hidden> writes:

> > 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.

Actually gh_set_x changes the _binding_ of a variable, rather than
modifying the value it's bound to. Basically, a variable in Scheme is
simply a name for a particular writable cell that contains one SCM,
and SCM itself is _not_ a cell (in particular, integers in Guile are
not represented by pointers to a box, they're recognised by a
particular bit-pattern of a SCM value).

So basically you just can't change a value of a SCM without changing
its identity. :)

-- 
How to eff the ineffable?



reply via email to

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