| kind | = | "DefaultBehavior Aspects Pointcut" |
Mimics
Inactive cells
Active cells
- <<(advice)
- add(name, advice)
- addAdviceOnCell(cellName, advice, adviceName nil)
- addToJoins(matches, joins)
- advice?(obj)
- cacheCall?(obj)
- remove(name)
- removeAll(name)
- removeAllNamedAdvice(cellName, name)
- removeFirstNamedAdvice(cellName, name)
- removeFromJoins(excepts, joins)
Specs
Inactive cells (details)
Active cells (details)
nil
[ show source ]
method(advice, joins = set(*(joinPoints)) addToJoins(self cell(:matching), joins) removeFromJoins(self cell(:except), joins) joins remove!(:kind) joins each(cellName, addAdviceOnCell(cellName, cell(:advice))) self )
nil
[ show source ]
method(name, advice, joins = set(*(joinPoints)) addToJoins(self cell(:matching), joins) removeFromJoins(self cell(:except), joins) joins remove!(:kind) joins each(cellName, addAdviceOnCell(cellName, cell(:advice), name)) self )
nil
[ show source ]
method(cellName, advice, adviceName nil,
primary = if(self cell(:receiver) cell?(cellName),
self cell(:receiver) cell(cellName),
macro(
bind(restart(useValue, fn(newValue, newValue)),
error!(Condition Error NoSuchCell, message: call message, context: call ground, receiver: call receiver, cellName: call message name))
)
)
theMacro = nil
case(type,
:before,
theMacro = if(cacheCall?(cell(:advice)),
if(cacheCall?(cell(:primary)),
macro(
call activateValueWithCachedArguments(@@ cell(:advice))
call activateValueWithCachedArguments(@@ cell(:primary))),
macro(
call activateValueWithCachedArguments(@@ cell(:advice))
call resendToValue(@@ cell(:primary)))),
if(cacheCall?(cell(:primary)),
macro(
call activateValue(@@ cell(:advice))
call activateValueWithCachedArguments(@@ cell(:primary))),
macro(
call activateValue(@@ cell(:advice))
call resendToValue(@@ cell(:primary))))),
:after,
theMacro = if(cacheCall?(cell(:advice)),
if(cacheCall?(cell(:primary)),
macro(
result = call activateValueWithCachedArguments(@@ cell(:primary))
call activateValueWithCachedArguments(@@ cell(:advice), aspectResult: result)
result
),
macro(
result = call resendToValue(@@ cell(:primary))
call activateValueWithCachedArguments(@@ cell(:advice), aspectResult: result)
result
)),
if(cacheCall?(cell(:primary)),
macro(
result = call activateValueWithCachedArguments(@@ cell(:primary))
call activateValue(@@ cell(:advice), aspectResult: result)
result
),
macro(
result = call resendToValue(@@ cell(:primary))
call activateValue(@@ cell(:advice), aspectResult: result)
result))),
:around,
theMacro = if(cacheCall?(cell(:advice)),
if(cacheCall?(cell(:primary)),
macro(
aspectCall = macro(ss = if(@ kind ==("Locals"), @ self, @)
call activateValueWithCachedArguments(@@ cell(:primary), ss))
cell(:aspectCall) primary = @@ cell(:primary)
call activateValueWithCachedArguments(@@ cell(:advice), self, aspectCall: cell(:aspectCall))
),
macro(
aspectCall = macro(ss = if(@ kind ==("Locals"), @ self, @)
call resendToValue(@@ cell(:primary), ss))
cell(:aspectCall) primary = @@ cell(:primary)
call activateValueWithCachedArguments(@@ cell(:advice), self, aspectCall: cell(:aspectCall))
)),
if(cacheCall?(cell(:primary)),
macro(
aspectCall = macro(ss = if(@ kind ==("Locals"), @ self, @)
call activateValueWithCachedArguments(@@ cell(:primary), ss))
cell(:aspectCall) primary = @@ cell(:primary)
call activateValue(@@ cell(:advice), self, aspectCall: cell(:aspectCall))
),
macro(
aspectCall = macro(ss = if(@ kind ==("Locals"), @ self, @)
call resendToValue(@@ cell(:primary), ss))
cell(:aspectCall) primary = @@ cell(:primary)
call activateValue(@@ cell(:advice), self, aspectCall: cell(:aspectCall)))))
)
cell(:theMacro) pointcut = self
cell(:theMacro) advice = cell(:advice)
cell(:theMacro) primary = cell(:primary)
cell(:theMacro) documentation = cell(:primary) documentation
if(adviceName, cell(:theMacro) adviceName = adviceName)
if(advice?(cell(:primary)), cell(:primary) outerAdvice = cell(:theMacro))
self cell(:receiver) cell(cellName) = cell(:theMacro)
)
nil
[ show source ]
method(matches, joins,
case(cell(:matches),
:any,
self cell(:receiver) cellNames(true, Origin) each(cn, joins <<(cn)),
:anyFromSelf,
self cell(:receiver) cellNames(false) each(cn, joins <<(cn)),
or(Regexp, LexicalBlock),
self cell(:receiver) cellNames(true, Origin) grep(cell(:matches), cn, joins <<(cn)),
List,
matches each(m, addToJoins(m, joins))
)
)
nil
[ show source ]
method(obj,
cell(:obj) cell?(:kind?) &&((cell(:obj) kind?("DefaultMacro") &&(cell(:obj) cell?(:advice))))
)
nil
[ show source ]
method(obj,
case(cell(:obj) kind,
"DefaultMethod", true,
"LexicalBlock", true,
"LexicalMacro", true,
"DefaultMacro", true,
"DefaultSyntax", true,
"JavaMethod", true,
false)
)
nil
[ show source ]
method(name, joins = set(*(joinPoints)) addToJoins(self cell(:matching), joins) removeFromJoins(self cell(:except), joins) joins remove!(:kind) joins each(cellName, removeFirstNamedAdvice(cellName, name)) self )
nil
[ show source ]
method(name, joins = set(*(joinPoints)) addToJoins(self cell(:matching), joins) removeFromJoins(self cell(:except), joins) joins remove!(:kind) joins each(cellName, removeAllNamedAdvice(cellName, name)) self )
nil
[ show source ]
method(cellName, name,
currVal = self cell(:receiver) cell(cellName)
while(advice?(cell(:currVal)),
if(cell(:currVal) cell?(:adviceName) &&(cell(:currVal) adviceName ==(name)) &&(cell(:currVal) pointcut type ==(self type)),
if(cell(:currVal) cell?(:outerAdvice),
outer = cell(:currVal) cell(:outerAdvice)
cell(:outer) primary = cell(:currVal) cell(:primary)
if(advice?(cell(:currVal) cell(:primary)),
cell(:currVal) cell(:primary) outerAdvice = cell(:outer)),
self cell(:receiver) cell(cellName) = cell(:currVal) cell(:primary)
if(advice?(cell(:currVal) cell(:primary)),
cell(:currVal) cell(:primary) removeCell!(:outerAdvice))
)
)
currVal = cell(:currVal) cell(:primary)
)
)
nil
[ show source ]
method(cellName, name,
currVal = self cell(:receiver) cell(cellName)
while(advice?(cell(:currVal)),
if(cell(:currVal) cell?(:adviceName) &&(cell(:currVal) adviceName ==(name)) &&(cell(:currVal) pointcut type ==(self type)),
if(cell(:currVal) cell?(:outerAdvice),
outer = cell(:currVal) cell(:outerAdvice)
cell(:outer) primary = cell(:currVal) cell(:primary)
if(advice?(cell(:currVal) cell(:primary)),
cell(:currVal) cell(:primary) outerAdvice = cell(:outer)),
self cell(:receiver) cell(cellName) = cell(:currVal) cell(:primary)
if(advice?(cell(:currVal) cell(:primary)),
cell(:currVal) cell(:primary) removeCell!(:outerAdvice))
)
return)
currVal = cell(:currVal) cell(:primary)
)
bind(restart(ignore, fn),
error!(Condition Error NoSuchAdvice, cellName: cellName, adviceName: name))
)
nil
[ show source ]
method(excepts, joins,
case(cell(:excepts),
or(Regexp, LexicalBlock),
toRemove = joins grep(cell(:excepts))
toRemove each(tr, joins remove!(tr)),
List,
excepts each(ex, removeFromJoins(ex, joins)),
Symbol,
joins remove!(excepts)
)
)