lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Random output in LilyPond Log


From: Urs Liska
Subject: Re: Random output in LilyPond Log
Date: Thu, 12 Jul 2018 23:37:21 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0



Am 12.07.2018 um 23:04 schrieb Freeman Gilmore:


On Thu, Jul 12, 2018 at 4:54 PM, Urs Liska <address@hidden> wrote:

Hi Freeman,

I'm not completely sure about the internals but #(display) procduces its output in some unpredictable manner. Sometimes, when you (display) some very large structures it may be totally interrupted by other output (at least in Frescobaldi).

When you want more reliable output (especially if you want to follow the order of operations) you could rather use

mylist = #(list 'red random 12)
#(ly:message "My list: ~a" mylist)

Good luck
Urs


Am 12.07.2018 um 20:17 schrieb Freeman Gilmore:
I am using Frescobaldi and studying the Scheme Book.    When I compile,

mylist = #( list 'red  random 12 )
#(display mylist)

I get two different results in the LilyPond Log, see below.    The line, 

(red #<primitive-procedure random> 12)

changes  positions randomly when compile.   Would someone explain?

Thank you, ƒg

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Starting lilypond-windows.exe 2.19.81 [Untitled]...

Processing `c:/users/free/appdata/local/temp/frescobaldi-1jampp/tmpzk5nkr/document.ly'

Parsing...

(red #<primitive-procedure random> 12)

c:/users/free/appdata/local/temp/frescobaldi-1jampp/tmpzk5nkr/document.ly:1: warning: no \version statement found, please add

\version "2.19.81"

for future compatibility

Success: compilation successfully completed

Completed successfully in 0.9".

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Starting lilypond-windows.exe 2.19.81 [Untitled]...

Processing `c:/users/free/appdata/local/temp/frescobaldi-1jampp/tmpzk5nkr/document.ly'

Parsing...

c:/users/free/appdata/local/temp/frescobaldi-1jampp/tmpzk5nkr/document.ly:1: warning: no \version statement found, please add

\version "2.19.81"

for future compatibility

(red #<primitive-procedure random> 12)

Success: compilation successfully completed

Completed successfully in 0.7".



_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user


_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user

Thank you Urs, to make it clear just use simple numbers it dos the same:

mylist = #( list  6 12 )
#(display mylist)

Yes, it doesn't have anything to do with *what* you print to the console but with *how* (i.e. "display" versus "ly:message").
As David pointed out there are different output channels for a program: stderr and stdout.
Probably the issue is that Frescobaldi (that interacts with the LilyPond terminal through Python and PyQt) fetches this output through a mechanism called "Signals and Slots", which does not provide guaranteed order of operations but somehow responds to events. It is pretty likely that this is the cause for seemingly random order of output.

When you are in need of reliable instantaneous output you should use ly:message rather than display, although it takes a little more effort.

HTH
Urs


reply via email to

[Prev in Thread] Current Thread [Next in Thread]