support unkebabification in #()-forms
which are vectors in Chicken, {}-initializers in C
This commit is contained in:
10
sexc.scm
10
sexc.scm
@@ -58,6 +58,15 @@
|
|||||||
(define (walk-generic form acc)
|
(define (walk-generic form acc)
|
||||||
(cond
|
(cond
|
||||||
((null? form) (cons '() acc))
|
((null? form) (cons '() acc))
|
||||||
|
|
||||||
|
;; vector, e.g. {}-initializer
|
||||||
|
((vector? form)
|
||||||
|
(cons
|
||||||
|
(list->vector
|
||||||
|
(car (walk-sex-tree (vector->list form) (list))))
|
||||||
|
acc))
|
||||||
|
|
||||||
|
;; atom (hopefully)
|
||||||
((not (list? form)) (cons (atom-to-fmt-c form) acc))
|
((not (list? form)) (cons (atom-to-fmt-c form) acc))
|
||||||
|
|
||||||
;; special case - replace unquote with its expansion
|
;; special case - replace unquote with its expansion
|
||||||
@@ -73,6 +82,7 @@
|
|||||||
((and (symbol? (car form))
|
((and (symbol? (car form))
|
||||||
(char=? #\. (string-ref (symbol->string (car form)) 0)))
|
(char=? #\. (string-ref (symbol->string (car form)) 0)))
|
||||||
(cons (make-field-access form) acc))
|
(cons (make-field-access form) acc))
|
||||||
|
|
||||||
;; toplevel, or a start of a regular list form
|
;; toplevel, or a start of a regular list form
|
||||||
(else
|
(else
|
||||||
(let ((new-acc (list)))
|
(let ((new-acc (list)))
|
||||||
|
|||||||
Reference in New Issue
Block a user