- (arg-names
- (map symbol->string
- (cddr (cadr (procedure-source func)))))
- (doc (procedure-documentation func))
- (sign (object-property func 'music-function-signature))
- (type-names (map type-name sign))
-
+ (full-doc (procedure-documentation func))
+ (match-args (and full-doc (string-match "^\\([^)]*\\)\n" full-doc)))
+ (arg-names (if match-args
+ (with-input-from-string (match:string match-args) read)
+ (circular-list "arg")))
+ (doc (if match-args (match:suffix match-args) full-doc))
+ (sign (ly:music-function-signature music-func))
+ (type-names (map (lambda (pred)
+ (if (pair? pred)
+ (format #f "[~a]" (type-name (car pred)))
+ (format #f "(~a)" (type-name pred))))
+ sign))