Hi Orm, On Wed, Mar 4, 2015 at 3:54 PM, Orm Finnendahl < orm.finnend...@selma.hfmdk-frankfurt.de> wrote:
> Dear David, > > Am Mittwoch, den 04. März 2015 um 15:35:46 Uhr (-0600) schrieb David > Nalesnik: > > > > I would like to be able to return the argument list of a Scheme function, > > say as a list of symbols. > > I'm not sure I understand what exactly you're looking for. In scheme, > you can assign a name to all arguments of a function and refer to it > in the function body if you use dot notation. All arguments are > accessible within the body as a list referred to by the symbol after > the dot: > > (define (return-args . args) > args) > > > (return-args 1 2 3 'blah 'foo "blub") > > -> (1 2 3 blah foo "blub") > > Does that answer your question? > Sorry for being opaque! What I'm trying to do (ultimately) is come up with a way to automatically document the large number of public Scheme functions (like grob::has interface or grob::name) in a similar format as used for the functions here: http://lilypond.org/doc/v2.18/Documentation/internals/scheme-functions Some of the information is easily accessible: procedure-name gives us the name of the function, procedure-documentation gives the doc string. What I'm missing is a good way to get at the names of the arguments. Now I suppose I could manipulate strings. Something like the following (just a proof-of-concept I just hacked together): #(use-modules (ice-9 regex)) #(define (find-args proc) (let* ((str (format #f "~a" proc)) (s (string-match "\\(.*\\)" str))) (match:substring s))) #(display (find-args grob-interpret-markup)) ==> (grob text) However, this feels a little hacky to me, and I'm hoping that there's some better technique available to get at the names assigned to the arguments. --David
_______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user