Advertisement
Guest User

Slime not showing local variables in :after of mkinstance

a guest
Dec 9th, 2019
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. Below is the source code snippet for the circular buffer:
  2.  
  3. (defclass circular-buffer ()
  4. ((store :accessor store :type vector)
  5. (head :accessor head :type (integer 0) :initform 0)
  6. (tail :accessor tail :type (integer 0) :initform 0)
  7. (granularity :accessor granularity :type (integer 0) :initarg :granularity)
  8. (charge :accessor charge :type (integer 0) :initform 0))
  9. (:default-initargs
  10. :granularity 16))
  11.  
  12. (defmethod initialize-instance :after ((o circular-buffer) &rest rest &key size granularity)
  13. (declare (ignore rest) (type (integer 1) size))
  14. (let ((actual-size (+ (- size (mod size granularity)) granularity)))
  15. (setf (store o) (make-array actual-size :initial-element nil :adjustable t)
  16. (charge o) (- actual-size (1+ size)))))
  17.  
  18. Below is the SLDB stack trace in slime. The lowest frame does not show any of the actual variables one would expect:
  19.  
  20. Evaluating call:
  21. (+ SIZE 1)
  22. With unknown arguments
  23. [Condition of type SB-EXT:STEP-FORM-CONDITION]
  24.  
  25. Restarts:
  26. 0: [STEP-CONTINUE] Resume normal execution
  27. 1: [STEP-OUT] Resume stepping after returning from this function
  28. 2: [STEP-NEXT] Step over call
  29. 3: [STEP-INTO] Step into call
  30. 4: [*ABORT] Return to SLIME's top level.
  31. 5: [ABORT] abort thread (#<THREAD "worker" RUNNING {10043AECD3}>)
  32.  
  33. Backtrace:
  34. 0: ((:METHOD INITIALIZE-INSTANCE :AFTER (CIRCULAR-BUFFER:CIRCULAR-BUFFER)) #<CIRCULAR-BUFFER:CIRCULAR-BUFFER {10049AE8F3}> :SIZE 89 :GRANULARITY 16) [fast-method]
  35. Locals:
  36. #:.DEFAULTING-TEMP. = 89
  37. #:.DEFAULTING-TEMP.#1 = 16
  38. CIRCULAR-BUFFER::O = #<CIRCULAR-BUFFER:CIRCULAR-BUFFER {10049AE8F3}>
  39. 1: ((LAMBDA (SB-PCL::|.P0.|) :IN "/home/nick/quicklisp/local-projects/trading-core/examples/backtesting-simulation.fasl") #<unavailable argument>)
  40. 2: ((:METHOD INITIALIZE-INSTANCE :AFTER (SIMPLE-MOVING-AVERAGE)) #<SIMPLE-MOVING-AVERAGE {10042040A3}>) [fast-method]
  41. 3: ((LAMBDA (SB-PCL::|.P0.|) :IN "/home/nick/qu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement