[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lily-library.scm question
From: |
Patrick McCarty |
Subject: |
Re: lily-library.scm question |
Date: |
Fri, 29 May 2009 17:44:47 -0700 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
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