2011-12-23 12 views
14

में स्टेपर का उपयोग करने का एक सरल उदाहरण लिस्पॉर्क्स स्टेपर के साथ गणना के माध्यम से जाना सहज है, लेकिन मैं एसबीसीएल में इसे समझ नहीं सकता। क्या कोई मुझे कुछ सरल कार्य पर आरईपीएल में एसबीसीएल स्टेपर का उपयोग करने का एक कदम-दर-चरण उदाहरण दे सकता है? धन्यवाद।एसबीसीएल

उत्तर

22
* (proclaim '(optimize (debug 3))) 

* (defun foo (a b) (* (+ a b) b)) 

FOO 
* (step (foo 1 2)) 
; Evaluating call: 
; (FOO 1 2) 
; With arguments: 
; 1 
; 2 

1] step 
; Evaluating call: 
; (+ A B) 
; With unknown arguments 

0] step 
; Evaluating call: 
; (* (+ A B) B) 
; With unknown arguments 

0] step 
; (FOO 1 2) => 6 

आदेश:

Stepping: 
    START Selects the CONTINUE restart if one exists and starts 
     single-stepping. Single stepping affects only code 
     compiled with under high DEBUG optimization quality. 
     See User Manual for details. 
    STEP Steps into the current form. 
    NEXT Steps over the current form. 
    OUT Stops stepping temporarily, but resumes it when the topmost 
     frame that was stepped into returns. 
    STOP Stops single-stepping. 

SBCL मैनुअल देखें: single stepping

संबंधित मुद्दे