mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
WIP
This commit is contained in:
parent
2a46a8f235
commit
9ba8467ba0
1 changed files with 17 additions and 0 deletions
|
@ -9,3 +9,20 @@
|
|||
(set-cdr! a '(2))))))))
|
||||
|
||||
;; TODO: goal is a single cyc-seq containing all expressions as a single list
|
||||
(define (convert sexp)
|
||||
(define (flat sexp acc)
|
||||
(write `(flat ,sexp)) (newline)
|
||||
(cond
|
||||
((null? sexp) acc)
|
||||
((tagged-list? 'Cyc-seq sexp)
|
||||
(flat (cdr sexp) acc))
|
||||
((and (app? sexp)
|
||||
(tagged-list? 'Cyc-seq (car sexp)))
|
||||
(flat (cdar sexp) acc))
|
||||
(else
|
||||
(flat (cdr sexp) (cons sexp acc))))
|
||||
)
|
||||
(reverse
|
||||
(flat sexp '(Cyc-seq))))
|
||||
|
||||
(write (convert sexp))
|
||||
|
|
Loading…
Add table
Reference in a new issue