This is the mail archive of the guile@cygnus.com mailing list for the guile project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
> > Should Guile call a hook associated with the array to free its space? > > I can't think of exact reasons to shout "NO!", but that is what I want > to do. When things start to smell like C++, I get wary, > > I think Guile should have the concept of "indirect" uniform vectors. > These can appear in several situations: a pointer to something managed > by C, a sub-vector of an existing vector, or as a "handle" to a > vectored field of a record (heh, I had it all working here and then > broke it :-(). > > In all the above situations, Guile's GC should have no control over > the indirect vector. Well, I guess what I had in mind was your indirect uniform vectors (which Guile actually does have at the moment, if I understand the code correctly), where Guile will call a function specified by the owner of the underlying array when the indirect vector goes away. If it's literally true that Guile's GC should have no control over the underlying vector, then you can supply a null function for GC to call. What I think you actually want in some circumstances is simply notification that Guile isn't using the vector any more. Which is all the callback gives you. Since the callback is implemented by the owner of the array, Guile's GC not only has no control over the array, but will politely tell you whether it's even referring to it. Maybe it's still a bad idea. I don't like destructors either. But that's my rationale. > I have a (somewhat rough now) design for all this stuff. When I get a > couple of hours to quietly sit on it and write it all up, I'll post > here. Hopefull the fact that you see this promise will motivate me > further :) Looking forward to it.