[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Visionaries] WebScheme
From: |
Peter Minten |
Subject: |
Re: [Visionaries] WebScheme |
Date: |
Sun, 11 May 2003 11:46:22 +0200 |
The loose end hunt continues.
--
How do you attach metadata to a value in a field definition? This can be done
using [attribute^ value], the ^ suffix simply tells the reader to expand to
(set! address@hidden value) instead of (set! address@hidden value).
The reason I'm not giving fields the ^ prefix is that you'll more often give
metadata to fields than to values.
--
Guile has something called weak references. When something an object
weak-references to is garbage collected the object is garbage collected too. I'm
going to implement this too, but using triggers. Every object has a on-finalize
trigger, simply hook up to that to know when an object gets garbage collected.
Every object also has a force-finalize method, which is the destructor, note
that this method garbage collects even if there are active references to the
object. A safer way is the safe-finalize method, which only garbage collects
when there are no active references to the object anymore (only needed with GC
off). So a weak-reference from a to b can be written as (b.on-finalize.add
(lambda () a.force-finalize)) in the body of a. This mechanism also provides
enough flexibility to make a clean escape of the destructed variable possible
(for example connecting prev and next in a double linked list list).
There is a garbage collector object GC, with a field active. When active is set
to #f the GC is deactivated and the app must do explicit garbage collection.
Greetings,
Peter
- Re: Dogus (was: Re: [Visionaries] DG-Scheme), (continued)
- Re: Dogus (was: Re: [Visionaries] DG-Scheme), Norbert Bollow, 2003/05/05
- WebScheme (was: Re: Dogus (was: Re: [Visionaries] DG-Scheme)), Peter Minten, 2003/05/06
- [Visionaries] Re: WebScheme, Peter Minten, 2003/05/07
- Re: [Visionaries] Re: WebScheme, Peter Minten, 2003/05/08
- Re: [Visionaries] WebScheme, Peter Minten, 2003/05/09
- Re: [Visionaries] WebScheme, Peter Minten, 2003/05/11
- Re: [Visionaries] WebScheme,
Peter Minten <=
- Re: [Visionaries] WebScheme, Peter Minten, 2003/05/13
- Re: [Visionaries] WebScheme, Peter Minten, 2003/05/15
- Re: [Visionaries] WebScheme, James Michael DuPont, 2003/05/15
- Re: [Visionaries] WebScheme, Peter Minten, 2003/05/17
- Re: [Visionaries] WebScheme, James Michael DuPont, 2003/05/18
- Re: [Visionaries] WebScheme, James Michael DuPont, 2003/05/18
- Re: [Visionaries] WebScheme, Peter Minten, 2003/05/16