[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.lisp

line question about macros

Jim Newton

7/17/2015 9:04:00 AM

Can someone tell me the best way in slime to look at the source of a function with the macros expanded in place? For example, the following function uses let* and do-sites. I believe let* is a macro, and I know that do-sites is a macro which my program defined.

I want to look at the function definition with those macros expanded in place. Is it possible?

(defun gtk-box-call-update-preview (gc box results)
(when box
(let* ((dbox (make-site-set-box (make-point 1 1)
(make-point 50 50)))
(resized (make-image-morpher-resize results dbox)))
(let ((surface (slot-value box 'surface)))
(do-sites (site resized)
(surface-update gc (iref resized site) site surface))))))
2 Answers

Antsan

7/17/2015 3:26:00 PM

0

Am Freitag, 17. Juli 2015 11:04:05 UTC+2 schrieb Jim Newton:
> Can someone tell me the best way in slime to look at the source of a function with the macros expanded in place? For example, the following function uses let* and do-sites. I believe let* is a macro, and I know that do-sites is a macro which my program defined.
>
> I want to look at the function definition with those macros expanded in place. Is it possible?
>
> (defun gtk-box-call-update-preview (gc box results)
> (when box
> (let* ((dbox (make-site-set-box (make-point 1 1)
> (make-point 50 50)))
> (resized (make-image-morpher-resize results dbox)))
> (let ((surface (slot-value box 'surface)))
> (do-sites (site resized)
> (surface-update gc (iref resized site) site surface))))))

I'm not entirely sure I actually got what you want, but I think you might be
asking about M-x slime-macroexpand-1-inplace

Pascal J. Bourguignon

7/17/2015 10:15:00 PM

0

Antsan <thomas.bartscher@gmail.com> writes:

> Am Freitag, 17. Juli 2015 11:04:05 UTC+2 schrieb Jim Newton:
>> Can someone tell me the best way in slime to look at the source of a function with the macros expanded in place? For example, the following function uses let* and do-sites. I believe let* is a macro, and I know that do-sites is a macro which my program defined.
>>
>> I want to look at the function definition with those macros expanded in place. Is it possible?
>>
>> (defun gtk-box-call-update-preview (gc box results)
>> (when box
>> (let* ((dbox (make-site-set-box (make-point 1 1)
>> (make-point 50 50)))
>> (resized (make-image-morpher-resize results dbox)))
>> (let ((surface (slot-value box 'surface)))
>> (do-sites (site resized)
>> (surface-update gc (iref resized site) site surface))))))
>
> I'm not entirely sure I actually got what you want, but I think you might be
> asking about M-x slime-macroexpand-1-inplace

but it macroexpands only once.

You'd want slime-macroexpand-all-inplace.


--
__Pascal Bourguignon__ http://www.informat...
â??The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.� -- Carl Bass CEO Autodesk