N-ary version of logapp.
When passed an even number of arguments,
(logappn size1 int1 ... sizeN intN)
expands to a nest of logapps ending with 0:
(logapp size1 int1 ... (logapp sizeN intN 0)...)
where the last logapp could be optimized as a loghead without 0, but the current form keeps the macro simple and uniform.
When passed an odd number of arguments,
(logappn size1 int1 ... sizeN intN last)
expands to a nest of logapps ending with
(logapp size1 int1 ... (logapp sizeN intN last)...)
This macro supports the readable appending of bit chunks when passed an even number of arguments, e.g.
(logappn 32 base 8 padding 24 offset)
The ability to pass an odd number of arguments
is in spirit with logapp,
whose
Function:
(defun logappn-fn (args) (cond ((endp args) 0) ((endp (cdr args)) (car args)) (t (cons 'logapp (cons (car args) (cons (cadr args) (cons (logappn-fn (cddr args)) 'nil)))))))