;;;; You should have received a copy of the GNU General Public License
;;;; along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+; for define-safe-public when byte-compiling using Guile V2
+(use-modules (scm safe-utility-defs))
+
(define-public (construct-chord-elements root duration modifications)
"Build a chord on root using modifiers in @var{modifications}.
@code{NoteEvents} have duration @var{duration}.
;;;; You should have received a copy of the GNU General Public License
;;;; along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+; for define-safe-public when byte-compiling using Guile V2
+(use-modules (scm safe-utility-defs))
+
;; TODO: should link back into user manual.
(define-public music-descriptions
; for take, drop, take-while, list-index, and find-tail:
(use-modules (srfi srfi-1))
+; for define-safe-public when byte-compiling using Guile V2
+(use-modules (scm safe-utility-defs))
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; constants.
(srfi srfi-14)
(scm clip-region)
(scm memory-trace)
- (scm coverage))
+ (scm coverage)
+ (scm safe-utility-defs))
(define-public _ gettext)
;;; There are new modules defined in Guile V2.0 which we need to use.
(fresh-interface!))))
(set-module-obarray! iface (module-obarray mod))))))
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Safe definitions utility
-
-(define safe-objects
- (list))
-
-(define-macro (define-safe-public arglist . body)
- "Define a variable, export it, and mark it as safe, i.e. usable in
-LilyPond safe mode. The syntax is the same as `define*-public'."
- (define (get-symbol arg)
- (if (pair? arg)
- (get-symbol (car arg))
- arg))
-
- (let ((safe-symbol (get-symbol arglist)))
- `(begin
- (define*-public ,arglist
- ,@body)
- (set! safe-objects (cons (cons ',safe-symbol ,safe-symbol)
- safe-objects))
- ,safe-symbol)))
(define-safe-public (lilypond-version)
(string-join
;;;; You should have received a copy of the GNU General Public License
;;;; along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+; for define-safe-public when byte-compiling using Guile V2
+(use-modules (scm safe-utility-defs))
+
;; (use-modules (ice-9 optargs))
;;; ly:music-property with setter
;;;; You should have received a copy of the GNU General Public License
;;;; along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+; for define-safe-public when byte-compiling using Guile V2
+(use-modules (scm safe-utility-defs))
+
(define-public (set-paper-dimension-variables mod)
(module-define! mod 'dimension-variables
'(blot-diameter
--- /dev/null
+;;;; This file is part of LilyPond, the GNU music typesetter.
+;;;;
+;;;; Copyright (C) 1998--2011 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; Han-Wen Nienhuys <hanwen@xs4all.nl>
+;;;;
+;;;; LilyPond is free software: you can redistribute it and/or modify
+;;;; it under the terms of the GNU General Public License as published by
+;;;; the Free Software Foundation, either version 3 of the License, or
+;;;; (at your option) any later version.
+;;;;
+;;;; LilyPond is distributed in the hope that it will be useful,
+;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;;; GNU General Public License for more details.
+;;;;
+;;;; You should have received a copy of the GNU General Public License
+;;;; along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+;;;
+;;; Author Ian Hulin
+;;; Date 16 October 2011
+;;;
+
+(define-module (scm safe-utility-defs)
+#:use-module (ice-9 optargs)
+#:export (safe-objects)
+#:export-syntax (define-safe-public)
+#:re-export-syntax (define*-public))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Safe definitions utility
+
+(define safe-objects
+ (list))
+
+(define (get-symbol arg)
+ (if (pair? arg)
+ (get-symbol (car arg))
+ arg))
+
+
+(define-macro (define-safe-public arglist . body)
+ "Define a variable, export it, and mark it as safe, i.e. usable in
+LilyPond safe mode. The syntax is the same as `define*-public'."
+
+ (let ((safe-symbol (get-symbol arglist)))
+ `(begin
+ (define*-public ,arglist
+ ,@body)
+ (set! safe-objects (cons (cons ',safe-symbol ,safe-symbol)
+ safe-objects))
+ ,safe-symbol)))