next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Macaulay2Doc :: addHook(Symbol,Function)

addHook(Symbol,Function) -- add a hook function to an object for later processing

Synopsis

Code

/home/dan/src/M2/M2/Macaulay2/m2/methods.m2:516:56-516:125: --source code:
addHook   (HashTable,Thing,Function) := (obj,key,hook) -> (c := obj.cache; c#key = if c#?key then prepend(hook,c#key) else {hook})
/home/dan/src/M2/M2/Macaulay2/m2/methods.m2:512:63-512:121: --source code:
addHook   (MutableHashTable,Thing,Function) := (obj,key,hook) -> obj#key = if obj#?key then prepend(hook,obj#key) else {hook}

See also