mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Added mtrace debugging
This commit is contained in:
parent
9e6fb14e7f
commit
1e922a1128
1 changed files with 16 additions and 0 deletions
|
@ -10,16 +10,32 @@
|
|||
; (call-with-values (lambda () expr)
|
||||
; (lambda params (let*-values rest . body))))))
|
||||
|
||||
;; From http://okmij.org/ftp/Scheme/macros.html
|
||||
(define-syntax mtrace
|
||||
(syntax-rules ()
|
||||
((mtrace x)
|
||||
(begin
|
||||
(display "Trace: ") (write 'x) (newline)
|
||||
x))))
|
||||
|
||||
(define-syntax my-let-values
|
||||
(syntax-rules ()
|
||||
((my-let-values ("step") (binds ...) bind expr maps () () . body)
|
||||
(mtrace
|
||||
(let*-values (binds ... (bind expr)) (let maps . body)))
|
||||
)
|
||||
((my-let-values ("step") (binds ...) bind old-expr maps () ((params expr) . rest) . body)
|
||||
(mtrace
|
||||
(my-let-values ("step") (binds ... (bind old-expr)) () expr maps params rest . body))
|
||||
)
|
||||
((my-let-values ("step") binds (bind ...) expr (maps ...) (x . y) rest . body)
|
||||
(mtrace
|
||||
(my-let-values ("step") binds (bind ... tmp) expr (maps ... (x tmp)) y rest . body))
|
||||
)
|
||||
((my-let-values ("step") binds (bind ...) expr (maps ...) x rest . body)
|
||||
(mtrace
|
||||
(my-let-values ("step") binds (bind ... . tmp) expr (maps ... (x tmp)) () rest . body))
|
||||
)
|
||||
; ((my-let-values ((params expr) . rest) . body)
|
||||
; (my-let-values ("step") () () expr () params rest . body))
|
||||
))
|
||||
|
|
Loading…
Add table
Reference in a new issue