| activatable | = | true |
DefaultMacro is the instance all non-lexical macros in the system are derived from.
Mimics
Inactive cells
Active cells
- argumentsCode()
- arity()
- call(+[arguments])
- code()
- formattedCode()
- inspect()
- message()
- name()
- notice()
Specs
Inactive cells (details)
Active cells (details)
returns the code for the argument definition
DefaultMacro argumentsCode
- - should validate type of receiver
[ show source ]
cell("DefaultMacro") should checkReceiverTypeOn(:argumentsCode)
returns the full code of this macro, as a Text
DefaultMacro code
- - should validate type of receiver
[ show source ]
cell("DefaultMacro") should checkReceiverTypeOn(:code)
returns idiomatically formatted code for this macro
DefaultMacro formattedCode
- - should validate type of receiver
[ show source ]
cell("DefaultMacro") should checkReceiverTypeOn(:formattedCode)
Returns a text inspection of the object
DefaultMacro inspect
- - should return the code inside the macro
[ show source ]
macro(foo bar) inspect should ==("macro(foo bar)") macro(123 +(444)) inspect should ==("macro(123 +(444))") - - should prep) the name if it is available
[ show source ]
x = macro(foo bar) cell(:x) inspect should ==("x:macro(foo bar)") x = macro(123 +(444)) cell(:x) inspect should ==("x:macro(123 +(444))") - - should validate type of receiver
[ show source ]
cell("DefaultMacro") should checkReceiverTypeOn(:inspect)
returns the message chain for this macro
DefaultMacro message
- - should validate type of receiver
[ show source ]
cell("DefaultMacro") should checkReceiverTypeOn(:message)
returns the name of the macro
DefaultMacro name
- - should validate type of receiver
[ show source ]
cell("DefaultMacro") should checkReceiverTypeOn(:name)
Returns a brief text inspection of the object
DefaultMacro notice
- - should just return a simple description without code
[ show source ]
macro notice should ==("macro(...)") macro(nil) notice should ==("macro(...)") macro(foo bar xxxxxx) notice should ==("macro(...)") - - should prep) the name if there is a name available
[ show source ]
x = macro cell(:x) notice should ==("x:macro(...)") x = macro(nil) cell(:x) notice should ==("x:macro(...)") x = macro(foo bar xxxxxx) cell(:x) notice should ==("x:macro(...)") - - should validate type of receiver
[ show source ]
cell("DefaultMacro") should checkReceiverTypeOn(:notice)