lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Retrieve procedure name from within its definition


From: Urs Liska
Subject: Re: Retrieve procedure name from within its definition
Date: Thu, 22 Feb 2018 00:27:10 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0



Am 21.02.2018 um 20:17 schrieb David Kastrup:
Urs Liska <address@hidden> writes:

Hi,

is it possible to retrieve the name of a function currently being defined?

myFunc =
#(define-void-function (arg)(type?)
   (display (function-that-returns-'myFunc'))
No.  define-void-function creates an anonymous function.  It's assigned
to myFunc here, but it could also get passed as an argument, made an
element of an array or whatever else.

At the time the function is being defined, there is no name associated
with it.


OK, somehow I was afraid it is like that.

Without much hope for a more positive answer: how about the other end of the process? When the function is actually executed it has been called by \myFunc. Isn't this information available somewhere, on a call stack or so? Could this be used to generate a message from the function that includes its name?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]