On Fri, May 29, 2009 at 04:17:58PM -0700, Mark Polesky wrote:
> 
> In lily-library.scm, why are some procedures defined with
> "define-public" and some others only with "define"?

To the best of my understanding...

The "define" procedures are generally only available within a single
module (the Scheme file they are defined in) unless they are exported.
For this to happen, a *named* module must be created with
"define-module" and then the procedures can be exported with the
"#:export" keyword.  See scm/layout-page-layout.scm for an example of
this.

The "use-modules" procedure must be used in order to access the
procedures exported in this way, unless you are in the same module of
course.  For example "post-process-pages" is defined in
scm/layout-page-layout.scm, exported, and used in
ly/paper-defaults-init.ly.

On the other hand, "define-public" creates a sort of *global
procedure*; any module has access to it.  "define-safe-public" creates
a global procedure that can be used in LilyPond's safe mode, IIUC.

Hope this helps,
Patrick


_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to