NewGlobalMacro creates a Macro for a global function with the specified arg count.
(function string, argCount int, expander MacroExpander, opts ...MacroOpt)
| 46 | |
| 47 | // NewGlobalMacro creates a Macro for a global function with the specified arg count. |
| 48 | func NewGlobalMacro(function string, argCount int, expander MacroExpander, opts ...MacroOpt) Macro { |
| 49 | m := ¯o{ |
| 50 | function: function, |
| 51 | argCount: argCount, |
| 52 | expander: expander} |
| 53 | for _, opt := range opts { |
| 54 | m = opt(m) |
| 55 | } |
| 56 | return m |
| 57 | } |
| 58 | |
| 59 | // NewReceiverMacro creates a Macro for a receiver function matching the specified arg count. |
| 60 | func NewReceiverMacro(function string, argCount int, expander MacroExpander, opts ...MacroOpt) Macro { |
no outgoing calls