guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stack traces


From: Amirouche
Subject: Re: Stack traces
Date: Sat, 18 Feb 2017 16:53:54 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0



Le 18/02/2017 à 16:50, Amirouche a écrit :


Le 18/02/2017 à 01:13, Matt Wette a écrit :
(use-modules (system repl repl))
(use-modules (system repl debug))

(define-syntax-rule (trap-here)
   (start-repl
    #:debug (make-debug (stack->vector (make-stack #t)) 0 "trap!" #t)))

(define (foo)
   (let iter ((sum 0) (vals '(1 2 3 5 8 2)))
     (trap-here)
     (if (null? vals) sum
    (iter (+ sum (car vals)) (cdr vals)))))

(foo)
It looks like that. Except `iter` should be defined in the namespace of the REPL.



Maybe iter is complicated, but at least sum and vals.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]