- (for-emitter (PARTICLE-VAR EMITTER ATTRIBUTES) BEGIN UPDATE)syntax
Iterates through the particles in EMITTER, assigning each one in sequence to the variable PARTICLE-VAR and executing UPDATE. The BEGIN form is used to perform any one-time actions that require the same scope, e.g. adding new particles. Particles added in BEGIN are not processed with UPDATE.
ATTRIBUTES is a list of the emitter’s attributes that should have accessors bound. Each attribute has a (ATTRIBUTE-ref PARTICLE) and (ATTRIBUTE-set! PARTICLE VALUE) function bound in the scope to the BEGIN and UPDATE forms, which are used to reference and set the attributes of the given particle. ATTRIBUTE-ref returns an srfi-4 vector of the type and number of the associated attribute, while ATTRIBUTE-set!’s VALUE should be an srfi-4 vector of the type and number of the attribute.