Re: documenting public Scheme functions

2015-04-07 Thread Gilles THIBAULT
Le mardi 7 avril 2015, 06:12:12 Pierre Perol-Schneider a écrit :
 Hi David,
 Simply thank you very, very much!!
+1
It works also with Lilypond 2.18.2

-- 
Gilles

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: documenting public Scheme functions

2015-04-07 Thread Thomas Morley
2015-04-07 23:40 GMT+02:00 Gilles THIBAULT gilles.thiba...@free.fr:
 Le mardi 7 avril 2015, 06:12:12 Pierre Perol-Schneider a écrit :
 Hi David,
 Simply thank you very, very much!!
 +1


Great!

thanks,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: documenting public Scheme functions

2015-04-07 Thread Paul Morris
This is fantastic, thanks David!

-Paul



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/documenting-public-Scheme-functions-tp174145p174189.html
Sent from the User mailing list archive at Nabble.com.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: documenting public Scheme functions

2015-04-06 Thread David Nalesnik
On Mon, Apr 6, 2015 at 6:53 PM, David Nalesnik david.nales...@gmail.com
wrote:



 Also, pure-unpure-containers  ...


unpure-pure...
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: documenting public Scheme functions

2015-04-06 Thread David Nalesnik
On Mon, Apr 6, 2015 at 6:53 PM, David Nalesnik david.nales...@gmail.com
wrote:

 Hi list,

 Here's something which I think will be useful to Schemers.

 Public functions written in Scheme aren't documented (except in the
 source).  (The list of Scheme functions in the Internals Reference
 consists of functions defined in C++ which are available in Scheme.)  The
 attached will produce a list of all such functions, giving useful
 information including a documentation string where provided.  Markup
 functions (which are documented elsewhere in their Lily syntax -- i.e.,
 \rest for rest-markup -- can be omitted.)  You can also list the contents
 of other modules.


A little more concise...
\version 2.19.17

#(define (get-binding-list iface)
   (ly:module-alist (resolve-module iface)))

#(define (symbol-closure-list iface)
   (let* ((bindings (get-binding-list iface))
  (closures
   (filter
(lambda (b) (closure? (cdr b)))
bindings))
  (closures
   (sort closures
 (lambda (x y) (symbol? (car x) (car y))
 closures))

#(define (omit-markup-functions lst)
   (remove
(lambda (elt)
  (string-contains (symbol-string (car elt)) markup))
lst))

#(define (symbol-closure-doc-list iface omit-markups?)
   (let* ((closures (symbol-closure-list iface))
  (closures (if omit-markups?
(omit-markup-functions closures)
closures)))
 (map (lambda (c)
(list
 (car c)
 (cdr c)
 (or (procedure-documentation (cdr c))
 DOCME)))
   closures)))

% UNCOMMENT THE FOLLOWING TO SEND TO A FILE:

%#(set-current-output-port (open-output-file closures.txt))

%% boolean determines whether markup commands (which are documented
%% in their Lily syntax) are included.

#(format #t ~:{~a~%~a~%~3t~s~%__~%~%~} (symbol-closure-doc-list '(lily) #t))

%#(format #t ~:{~a~%~a~%~3t~s~%__~%~%~} (symbol-closure-doc-list '(srfi srfi-1) #f))___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: documenting public Scheme functions

2015-04-06 Thread Pierre Perol-Schneider
Hi David,
Simply thank you very, very much!!
Cheers,
Pierre

2015-04-07 3:39 GMT+02:00 David Nalesnik david.nales...@gmail.com:



 On Mon, Apr 6, 2015 at 6:53 PM, David Nalesnik david.nales...@gmail.com
 wrote:

 Hi list,

 Here's something which I think will be useful to Schemers.

 Public functions written in Scheme aren't documented (except in the
 source).  (The list of Scheme functions in the Internals Reference
 consists of functions defined in C++ which are available in Scheme.)  The
 attached will produce a list of all such functions, giving useful
 information including a documentation string where provided.  Markup
 functions (which are documented elsewhere in their Lily syntax -- i.e.,
 \rest for rest-markup -- can be omitted.)  You can also list the contents
 of other modules.


 A little more concise...


 ___
 lilypond-user mailing list
 lilypond-user@gnu.org
 https://lists.gnu.org/mailman/listinfo/lilypond-user


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user