allow_self_reference

allow_self_reference — permits changes to be written back to the point of origin.

Syntax

allow_self_reference (symbol, allow)
    

Arguments

symbol

Any valid Gamma symbol.

allow

1 or any other non-zero value allows self-referential behavior; 0 disallows it.

Returns

The value of the allow parameter.

Description

This function tells Gamma not to generate a warning if a change function like on_change causes a sequence of events that changes the original point again.

Example

This example is from LinearXform.g.

method LinearXform.AddLinearXform (app, src, dst, mult, add, bidirectional_p?=nil)
{
    app.OnChange (src, `(@self).cbLinearXform (#@dst, value, @mult, @add));
    if (bidirectional_p && mult != 0)
    {
        allow_self_reference (src, 1);
        allow_self_reference (dst, 1);
        app.OnChange (dst, `(@self).cbLinearXform (#@src, value, 1/@mult, (@-add)/(@mult)));
    }
}