Inside a Chialisp program (not CLVM), I don’t understand the difference between defining a macro and a function. When does it make sense to define a macro instead of a function?
The Squaring a List program looks simpler when square
is defined a function:
(defun-inline square (input)
(* input input)
)
rather than when it’s defined as a macro:
(defmacro square (input)
(qq (* (unquote input) (unquote input)))
)
Note: both versions of the Squaring a list program result in identical CLVM.