From 12ff37c5152a0ffdcb4125eee05849fde1c508d9 Mon Sep 17 00:00:00 2001 From: alex-eg Date: Sat, 14 Jun 2025 19:02:45 +0300 Subject: [PATCH] support unkebabification in #()-forms which are vectors in Chicken, {}-initializers in C --- sexc.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sexc.scm b/sexc.scm index 419e304..08fe674 100644 --- a/sexc.scm +++ b/sexc.scm @@ -58,6 +58,15 @@ (define (walk-generic form acc) (cond ((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)) ;; special case - replace unquote with its expansion @@ -73,6 +82,7 @@ ((and (symbol? (car form)) (char=? #\. (string-ref (symbol->string (car form)) 0))) (cons (make-field-access form) acc)) + ;; toplevel, or a start of a regular list form (else (let ((new-acc (list)))