(define KW_GetWidgetChildren (foreign-primitive ((KW_Widget* widget)) "unsigned int count;\n" "C_word av[4] = { C_SCHEME_UNDEFINED, C_k, C_SCHEME_FALSE, C_SCHEME_FALSE} ;" "C_word ab[C_SIZEOF_POINTER], *a = ab;" "KW_Widget * const * children = KW_GetWidgetChildren(widget, &count);\n" "av[2] = C_fix(count);" "av[3] = C_a_i_address_to_pointer(&a, 0, (C_word)children);" "C_values(4, av);")) (define (get-children) (define extract-child (foreign-lambda* ((KW_Widget* children) (int i)) "C_return(children[i]);")) (receive (count child-ptr) (let lp ((i 0) (children '())) (if (= i count) children (lp (add1 i) (cons (extract-child child-ptr i) children))))))