chickadee » ck-macros » c-du

(c-du N) → list or '#fsyntax
(c-du N '(SUB1 ...)) → list or '#fsyntax

Convert from decimal integers to unary integers. If N is in the domain of SUB1, yields a list of that many elements, specifically the integers (N-1, ..., 0). Otherwise, yields '#f.

SUB1 is any operation that given N yields N-1, where 1 <= N. Defaults to c-dsub1, which supports 1 <= N <= 16. See the note for c-dsub1 for how to make an operation with a larger domain.

(ck () (c-quote (c-du '0)))
;; ==> '()
(ck () (c-quote (c-du '16)))
;; ==> '(15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0)
(ck () (c-quote (c-du '17)))
;; ==> '#f