Hi,
I would like to know whether there is a simple way how to get the
name of the block in which some code is placed. I have a code for some
logging like this:
(defconstant +development-version+ t)
(defvar *log-symbols* '(init config move pathfind))
(defvar *log-stream* t)
(defmacro logger (log-symbol message &rest rest)
(when +development-version+
`(when (member ,log-symbol *log-symbols*)
(format *log-stream* ,(concatenate 'string message "~%")
,@rest))))
and I would like to automatically put the name of the function in the
output, so when I use it in:
(defmethod update ((entity movable-entity) x y)
(logger 'move "moving ~a to [~a ~a]" entity x y)
...)
the logger macro expands the defmethod name into the string...
Thanks for any ideas,
Karol
On Sat, 18 Nov 2006 13:04:23 -0800, Karol Skocik wrote:
> Hi,
> I would like to know whether there is a simple way how to get the
> name of the block in which some code is placed.
Not sure I understand correctly, but maybe:
http://groups.google.com/group/comp.lang.lisp/msg/47d2fdfa75654423
--
Lars Rune Nøstdal
http://lars.nostdal.org/
Thats exactly it!
Thank you,
Karol
Lars Rune Nøstdal wrote:
> On Sat, 18 Nov 2006 13:04:23 -0800, Karol Skocik wrote:
>
> > Hi,
> > I would like to know whether there is a simple way how to get the
> > name of the block in which some code is placed.
>
> Not sure I understand correctly, but maybe:
> http://groups.google.com/group/comp.lang.lisp/msg/47d2fdfa75654423
>
> --
> Lars Rune Nøstdal
> http://lars.nostdal.org/