On Fri, Apr 29, 2011 at 3:27 AM, Meikel Brandmeyer wrote:
> Hi,
>
> Am Freitag, 29. April 2011 08:43:10 UTC+2 schrieb Ken Wesson:
>>
>> Yeah, that works if you have the object in hand and it's not wrapped
>> or anything. Of course it has the same problem: which component are
>> you interested in?
Hi,
Am Freitag, 29. April 2011 08:43:10 UTC+2 schrieb Ken Wesson:
> Yeah, that works if you have the object in hand and it's not wrapped
> or anything. Of course it has the same problem: which component are
> you interested in? I guess in this case you might strip everything
> before the last $,
On Fri, Apr 29, 2011 at 2:06 AM, Meikel Brandmeyer wrote:
> Hi,
>
> or just use the class name, which is what the stacktrace gives you anyway.
>
> user=> (class (fn [x] x))
> user$eval1$fn__2
> user=> (class (fn foo [x] x))
> user$eval5$foo__6
> user=> (defn bar [x] x)
> #'user/bar
> user=> (class
Hi,
or just use the class name, which is what the stacktrace gives you anyway.
user=> (class (fn [x] x))
user$eval1$fn__2
user=> (class (fn foo [x] x))
user$eval5$foo__6
user=> (defn bar [x] x)
#'user/bar
user=> (class bar)
user$bar
user=> (defn frob [f] (prn (class f)))
#'user/frob
user=> (frob
On Thu, Apr 28, 2011 at 6:36 AM, MohanR wrote:
> There should be a way to print the currently executing function and
> the calling function logging purposes ?
>
> I believe Java has StackTraceElement[] to do this.
And therefore so does Clojure:
user=> ((fn foo [] (map #(.getClassName %) (.getSta
There should be a way to print the currently executing function and
the calling function logging purposes ?
I believe Java has StackTraceElement[] to do this.
Thanks,
Mohan
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send
On 27 April 2011 01:09, Ken Wesson wrote:
> It has some limitations, though. Specifically, it won't work with
> local functions, even named ones:
Yes, good point!
A more foolproof way might be to use a macro, but then macros have
their own disadvantages.
It depends on what clj123123 wants to us
On Tue, Apr 26, 2011 at 7:18 PM, clj123123 wrote:
> Thank you James, this worked for me.
>
> On Apr 26, 4:11 pm, James Reeves wrote:
>> On 27 April 2011 00:05, clj123123 wrote:
>>
>> > I have a function:
>>
>> > (defn abc [] (println "blah"))
>>
>> > (defn blah2 [f] (println f))
>>
>> > (blah2 a
Thank you James, this worked for me.
On Apr 26, 4:11 pm, James Reeves wrote:
> On 27 April 2011 00:05, clj123123 wrote:
>
> > I have a function:
>
> > (defn abc [] (println "blah"))
>
> > (defn blah2 [f] (println f))
>
> > (blah2 abc)
>
> > I need to print out the name of the function passed to
On 27 April 2011 00:05, clj123123 wrote:
> I have a function:
>
> (defn abc [] (println "blah"))
>
> (defn blah2 [f] (println f))
>
> (blah2 abc)
>
> I need to print out the name of the function passed to blah2.
Then you want something like:
(defn blah2 [f] (println (:name (meta f
- James
I have a function:
(defn abc [] (println "blah"))
(defn blah2 [f] (println f))
(blah2 abc)
I need to print out the name of the function passed to blah2.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@g
11 matches
Mail list logo