[Openmcl-devel] extracting values of variables

slepstein at mindspring.com slepstein at mindspring.com
Sat Jun 27 17:51:39 PDT 2009


So that means if I want to operate on several local variables during a break, I have to setf temporary names for each of them, and manipulate those names? I can if I must, and thank you for the explanation (** and *** work too). If you are looking for user-friendly improvements, I'd suggest numbering the frames and variables, and providing some simpler way to manipulate them during a break. In MCL one typed (local #) but could reference local values and arguments only in the same frame. I do understand that this is more powerful, but it makes for difficult debugging…

-----Original Message-----
>From: Gary Byers <gb at clozure.com>
>Sent: Jun 27, 2009 6:49 PM
>To: slepstein at mindspring.com
>Cc: Stas Boukarev <stassats at gmail.com>, openmcl-devel at clozure.com
>Subject: Re: [Openmcl-devel] extracting values of variables
>
>
>
>On Sat, 27 Jun 2009, slepstein at mindspring.com wrote:
>
>> My problem is trying to manipulate values in the break. (Inspection is clear.) For example, how would I go about multiplying the values of the two slots during the break? And thank you for helping!
>>
>> ? (defclass bar () ((slot-1 :initarg :slot-1 :initform 1 :accessor slot-1)
>>                    (slot-2 :initarg :slot-2 :initform 2 :accessor slot-2)))
>> #<STANDARD-CLASS BAR>
>> ? (setf foo (make-instance 'bar))
>> #<BAR #x300041BBFE8D>
>> ? (describe foo)
>> #<BAR #x300041BBFE8D>
>> Class: #<STANDARD-CLASS BAR>
>> Wrapper: #<CCL::CLASS-WRAPPER BAR #x300041B0E94D>
>> Instance slots
>> SLOT-1: 1
>> SLOT-2: 2
>> ? (defun baz (x) (print (+ (slot-1 x) (slot-2 x))) (break))
>> BAZ
>> ? (baz foo)
>>
>> 3 
>>> Break: 
>>> While executing: BAZ, in process Listener(6).
>>> Type :GO to continue, :POP to abort, :R for a list of available restarts.
>>> If continued: Return from BREAK.
>>> Type :? for other options.
>> 1 > (:arg x 0)
>> #<BAR #x300041B154DD>
>
>At this point, the REPL variable * is set to that instance of BAR, so
>
>1> (slot-1 *)
>
>would access its SLOT-1 slot.
>




More information about the Openmcl-devel mailing list