From: Karol Skocik
Subject: how to find out in which enclosing block we are?
Date: 
Message-ID: <1163883863.852121.109860@e3g2000cwe.googlegroups.com>
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

From: Lars Rune Nøstdal
Subject: Re: how to find out in which enclosing block we are?
Date: 
Message-ID: <pan.2006.11.18.23.25.34.137358@gmail.com>
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/
From: Karol Skocik
Subject: Re: how to find out in which enclosing block we are?
Date: 
Message-ID: <1163893650.499099.318850@h54g2000cwb.googlegroups.com>
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/