Re: [openLilyLib] oll-core incompatible with Guile 2.2

2022-01-18 Thread Valentin Petzel
I have written a message to the list a year ago regarding this. The problem is 
that OLL has a call in oll-core/internal/control.scm:
(use-syntax (ice-9 syncase))
Which does not work anymore in 2.2, neither is it nescessary anymore, as guile 
2 provides R5RS natively.

My fix to this was to include a check for the guile version, like in the 
appended file.

There are a few other problems in certain OLL modules, which can also be 
mitigated.

Cheers,
Valentin

Am Mittwoch, 19. Jänner 2022, 01:45:04 CET schrieb Jean Abou Samra:
> Le 18/01/2022 à 20:43, Simon Albrecht a écrit :
> > Dear list,
> > 
> > I have started using the experimental 2.23.5 build with Guile 2.2 [1]
> > and it turns out to be incompatible with the core of openLilyLib.
> > 
> > Here are the error messages I got—it may be that only the first is
> > relevant:
> > [...]
> 
> Take a look at the attached patch (apply with 'git am').
> For me, it makes the file
> edition-engraver/usage-examples/example-1.ly work. Note,
> however, that ...
> 
> > I would have to delve in order to find the root of the error and solve
> > the problem, which I don’t really have time for, unless I must…
> 
> ... this applies to me as well, so I haven't tested
> anything else and don't intend to delve deeper than
> this for now.
> 
> Best,
> Jean;; control syntax
;;
;; Andrew Bernard 2017


(define-module (oll-core internal control))

(if (< (string->number (car (string-split (version) #\.))) 2)
(use-syntax (ice-9 syncase)))

;; when and unless from R6RS

(define-syntax when
  (syntax-rules ()
((when test result1 result2 ...)
 (if test
	 (begin result1 result2 ...)


(define-syntax unless
  (syntax-rules ()
((unless test result1 result2 ...)
 (if (not test)
	 (begin result1 result2 ...)



signature.asc
Description: This is a digitally signed message part.


Re: [openLilyLib] oll-core incompatible with Guile 2.2

2022-01-18 Thread Jean Abou Samra

Le 19/01/2022 à 01:45, Jean Abou Samra a écrit :

Le 18/01/2022 à 20:43, Simon Albrecht a écrit :

Dear list,

I have started using the experimental 2.23.5 build with Guile 2.2 [1] 
and it turns out to be incompatible with the core of openLilyLib.


Here are the error messages I got—it may be that only the first is 
relevant:

[...]



Take a look at the attached patch (apply with 'git am').
For me, it makes the file
edition-engraver/usage-examples/example-1.ly work. Note,
however, that ...


I would have to delve in order to find the root of the error and 
solve the problem, which I don’t really have time for, unless I must…


... this applies to me as well, so I haven't tested
anything else and don't intend to delve deeper than
this for now.



I forgot something: if you are using 2.23.4 or
higher (as with these experimental binaries), you
also need the attached in the edition-engraver.

Jean
From 12d3e43590cc091ecb1a4f5b8b9d06de5c28121f Mon Sep 17 00:00:00 2001
From: Jean Abou Samra 
Date: Wed, 19 Jan 2022 01:45:50 +0100
Subject: [PATCH] Replace ly:context-now with ly:context-current-moment

ly:context-now was doing exactly the same as ly:context-current-moment
and this duplication was removed in LilyPond 2.23.
---
 engine.scm | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/engine.scm b/engine.scm
index aee8adc..52552eb 100644
--- a/engine.scm
+++ b/engine.scm
@@ -756,7 +756,7 @@ Path: ~a" path)
 (define (start-translation-timestep trans)
   (log-slot "start-translation-timestep")
   (if (or (not start-translation-timestep-moment)
-  (ly:moment

Re: [openLilyLib] oll-core incompatible with Guile 2.2

2022-01-18 Thread Jean Abou Samra

Le 18/01/2022 à 20:43, Simon Albrecht a écrit :

Dear list,

I have started using the experimental 2.23.5 build with Guile 2.2 [1] 
and it turns out to be incompatible with the core of openLilyLib.


Here are the error messages I got—it may be that only the first is 
relevant:

[...]



Take a look at the attached patch (apply with 'git am').
For me, it makes the file
edition-engraver/usage-examples/example-1.ly work. Note,
however, that ...


I would have to delve in order to find the root of the error and solve 
the problem, which I don’t really have time for, unless I must…


... this applies to me as well, so I haven't tested
anything else and don't intend to delve deeper than
this for now.

Best,
Jean
From 84078085af9d83e4f5fa3bfa93f7804e99803698 Mon Sep 17 00:00:00 2001
From: Jean Abou Samra 
Date: Wed, 19 Jan 2022 01:37:41 +0100
Subject: [PATCH] Quick fixes for Guile 2 compatibility

Don't define when and unless in Guile 2, they're already defined and
the functionality of (ice-9 syncase) has been made available by
default, thus removing the module.

Use #f as explicit destination in format calls to silence warning.

Load  as identifier because define-method apparently no longer
accepts it as expression.
---
 internal/control.scm | 28 
 internal/file-handling.scm   |  3 +--
 internal/logging.scm | 10 +-
 internal/named-alists.scm|  3 +--
 internal/options.scm |  2 +-
 internal/os-path.scm |  6 +++---
 load/templates.ily   |  2 +-
 load/tools.ily   |  2 +-
 temp-package-declaration.ily |  6 +++---
 tree.scm | 15 ---
 usage-examples/properties.ly |  4 ++--
 usage-examples/stack.ly  |  6 ++
 util/consist-to-contexts.ily |  3 +--
 util/include-pattern.ily |  2 +-
 14 files changed, 46 insertions(+), 46 deletions(-)

diff --git a/internal/control.scm b/internal/control.scm
index 8a9c0b7..c1d9c19 100644
--- a/internal/control.scm
+++ b/internal/control.scm
@@ -5,20 +5,24 @@
 
 (define-module (oll-core internal control))
 
-(use-syntax (ice-9 syncase))
+(cond-expand
+ (guile-2)
+ (else
+  (use-syntax (ice-9 syncase))
 
-;; when and unless from R6RS
+  ;; when and unless from R6RS
 
-(define-syntax when
-  (syntax-rules ()
-((when test result1 result2 ...)
- (if test
-	 (begin result1 result2 ...)
+  (define-syntax when
+(syntax-rules ()
+  ((when test result1 result2 ...)
+   (if test
+   (begin result1 result2 ...)
 
 
-(define-syntax unless
-  (syntax-rules ()
-((unless test result1 result2 ...)
- (if (not test)
-	 (begin result1 result2 ...)
+  (define-syntax unless
+(syntax-rules ()
+  ((unless test result1 result2 ...)
+   (if (not test)
+   (begin result1 result2 ...)
 
+))
diff --git a/internal/file-handling.scm b/internal/file-handling.scm
index ff5c07b..ff9b75d 100644
--- a/internal/file-handling.scm
+++ b/internal/file-handling.scm
@@ -46,7 +46,7 @@
   (let ((parser (ly:parser-clone)))
 (ly:parser-parse-string parser "\\language \"nederlands\"")
 (ly:parser-parse-string parser
-  (format "\\include \"~a\"" file))
+  (format #f "\\include \"~a\"" file))
 #t)
   #f))
 
@@ -63,4 +63,3 @@
 		(set! lines (cons line lines))
 		(lp (read-line h 'concat))
   #f)))
-
diff --git a/internal/logging.scm b/internal/logging.scm
index 3360287..7de996b 100644
--- a/internal/logging.scm
+++ b/internal/logging.scm
@@ -38,12 +38,12 @@
 
 ; Generic function to consistently format the output for the logging functions
 (define (oll-format-log fmt vals)
-  (apply format (format "\n\n~a\n" fmt) vals))
+  (apply format #f (format "\n\n~a\n" fmt) vals))
 
 ; Open log file
 (define oll-logfile
   (open-output-file
-   (format "~a.oll.log" (ly:parser-output-name (*parser*)
+   (format #f "~a.oll.log" (ly:parser-output-name (*parser*)
 
 ; Generic function to consistently write to log file.
 ;  is a sectioning header in the log file
@@ -57,7 +57,7 @@
  (number->string (cadr (ly:input-file-line-char-column (*location*
 
  "\n~a:\n"
- (apply format fmt vals)
+ (apply format #f fmt vals)
  "\n\n")
 title))
 
@@ -70,7 +70,7 @@
(begin
 ;log-to-file "Error" fmt vals)
 (ly:input-message (*location*)
- (format "Error:~a" (oll-format-log fmt vals)))
+ (format #f "Error:~a" (oll-format-log fmt vals)))
 (ly:error ""
 
 (define (oll:warn fmt . vals)
@@ -99,4 +99,4 @@
 (export oll:error)
 (export oll:warn)
 (export oll:log)
-(export oll:debug)
\ No newline at end of file
+(export oll:debug)
diff --git a/internal/named-alists.scm b/internal/named-alists.scm
index e494e72..147eafb 100644
--- a/internal/named-alists.scm
+++ b/internal/named-alists.scm
@@ -78,7 +78,7 @@ using key '~a' and ~a.  This will create a new alist instead,
 which is probably not intended."
 alst-name funcname 

[openLilyLib] oll-core incompatible with Guile 2.2

2022-01-18 Thread Simon Albrecht

Dear list,

I have started using the experimental 2.23.5 build with Guile 2.2 [1] 
and it turns out to be incompatible with the core of openLilyLib.


Here are the error messages I got—it may be that only the first is relevant:

%%
/home/simon/openlilylib/oll-core/internal/init.ily:46:2: error: GUILE 
signaled an error for the expression beginning here

#
 (use-modules
Omitting the destination on a call to format is deprecated.
Pass #f as the destination, before the format string.
Unbound variable: use-syntax
/home/simon/openlilylib/oll-core/internal/init.ily:59:1: error: unknown 
escaped string: `\registerOption'


\registerOption #'(_propsets) #'()
/home/simon/openlilylib/oll-core/internal/init.ily:59:17: error: syntax 
error, unexpected SCM_TOKEN, expecting '.' or '='

\registerOption
    #'(_propsets) #'()
/home/simon/openlilylib/oll-core/internal/init.ily:60:1: error: unknown 
escaped string: `\definePropertySet'


\definePropertySet #'(OLL global) #'()
/home/simon/openlilylib/oll-core/internal/init.ily:60:20: error: syntax 
error, unexpected SCM_TOKEN, expecting '.' or '='

\definePropertySet
   #'(OLL global) #'()
/home/simon/openlilylib/oll-core/internal/init.ily:63:1: error: unknown 
escaped string: `\registerOption'


\registerOption oll-core.root #(this-parent)
/home/simon/openlilylib/oll-core/internal/init.ily:63:17: error: syntax 
error, unexpected SYMBOL, expecting '.' or '='

\registerOption
    oll-core.root #(this-parent)
/home/simon/openlilylib/oll-core/internal/init.ily:63:31: error: syntax 
error, unexpected SCM_TOKEN, expecting '='

\registerOption oll-core.root
  #(this-parent)
/home/simon/openlilylib/oll-core/internal/init.ily:66:1: error: unknown 
escaped string: `\registerOption'


\registerOption loaded-packages #'(oll-core)
/home/simon/openlilylib/oll-core/internal/init.ily:67:1: error: unknown 
escaped string: `\registerOption'


\registerOption loaded-modules.oll-core #'()
/home/simon/openlilylib/oll-core/internal/init.ily:67:41: error: syntax 
error, unexpected SCM_TOKEN, expecting '='

\registerOption loaded-modules.oll-core
    #'()
/home/simon/openlilylib/oll-core/internal/init.ily:79:1: error: unknown 
escaped string: `\setLogLevel'


\setLogLevel log
ERROR: In procedure %resolve-variable:
Unbound variable: getOption
%%

I would have to delve in order to find the root of the error and solve 
the problem, which I don’t really have time for, unless I must…


Can someone help me out?

Best regards
Simon

[1] https://lists.gnu.org/archive/html/lilypond-devel/2021-12/msg7.html




Re: [openLilyLib] oll-core incompatible with Guile 2.2

2022-01-18 Thread Simon Albrecht

https://github.com/openlilylib/oll-core/issues/62

On 18/01/2022 20:43, Simon Albrecht wrote:
I have started using the experimental 2.23.5 build with Guile 2.2 [1] 
and it turns out to be incompatible with the core of openLilyLib.


Here are the error messages I got—it may be that only the first is 
relevant:


%%
/home/simon/openlilylib/oll-core/internal/init.ily:46:2: error: GUILE 
signaled an error for the expression beginning here

#
 (use-modules
Omitting the destination on a call to format is deprecated.
Pass #f as the destination, before the format string.
Unbound variable: use-syntax
/home/simon/openlilylib/oll-core/internal/init.ily:59:1: error: 
unknown escaped string: `\registerOption'


\registerOption #'(_propsets) #'()
/home/simon/openlilylib/oll-core/internal/init.ily:59:17: error: 
syntax error, unexpected SCM_TOKEN, expecting '.' or '='

\registerOption
    #'(_propsets) #'()
/home/simon/openlilylib/oll-core/internal/init.ily:60:1: error: 
unknown escaped string: `\definePropertySet'


\definePropertySet #'(OLL global) #'()
/home/simon/openlilylib/oll-core/internal/init.ily:60:20: error: 
syntax error, unexpected SCM_TOKEN, expecting '.' or '='

\definePropertySet
   #'(OLL global) #'()
/home/simon/openlilylib/oll-core/internal/init.ily:63:1: error: 
unknown escaped string: `\registerOption'


\registerOption oll-core.root #(this-parent)
/home/simon/openlilylib/oll-core/internal/init.ily:63:17: error: 
syntax error, unexpected SYMBOL, expecting '.' or '='

\registerOption
    oll-core.root #(this-parent)
/home/simon/openlilylib/oll-core/internal/init.ily:63:31: error: 
syntax error, unexpected SCM_TOKEN, expecting '='

\registerOption oll-core.root
  #(this-parent)
/home/simon/openlilylib/oll-core/internal/init.ily:66:1: error: 
unknown escaped string: `\registerOption'


\registerOption loaded-packages #'(oll-core)
/home/simon/openlilylib/oll-core/internal/init.ily:67:1: error: 
unknown escaped string: `\registerOption'


\registerOption loaded-modules.oll-core #'()
/home/simon/openlilylib/oll-core/internal/init.ily:67:41: error: 
syntax error, unexpected SCM_TOKEN, expecting '='

\registerOption loaded-modules.oll-core
    #'()
/home/simon/openlilylib/oll-core/internal/init.ily:79:1: error: 
unknown escaped string: `\setLogLevel'


\setLogLevel log
ERROR: In procedure %resolve-variable:
Unbound variable: getOption
%%