Re: scheme with Frescobaldi

2018-07-03 Thread David Kastrup
Knute Snortum  writes:

> Late to the party, but I just wanted to add that if you want a nice REPL
> for Scheme, click on https://repl.it and select Scheme as the language.

Sort of more representative would be

lilypond scheme-sandbox


-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: scheme with Frescobaldi

2018-07-03 Thread Knute Snortum
Late to the party, but I just wanted to add that if you want a nice REPL
for Scheme, click on https://repl.it and select Scheme as the language.

---
Knute Snortum
(via Gmail)


On Wed, Jun 27, 2018 at 2:36 PM David Kastrup  wrote:

> Aaron Hill  writes:
>
> > On 2018-06-27 08:14, Simon Albrecht wrote:
> >> On 26.06.2018 03:02, Aaron Hill wrote:
> >>> Here is the reference on `let` for Guile:
> >>>
> >>>
> https://www.gnu.org/software/guile/manual/html_node/Local-Bindings.html#Local-Bindings
> >>
> >> I guess for the time being we should stick with the Guile 1.8 manual:
> >> <
> https://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/Local-Bindings.html#Local-Bindings
> >
> >
> > Ah, sorry about that.  The new docs are always what shows up in a web
> > search, and I forgot to manually adjust for the older version of Guile
> > that LilyPond uses.  That said, I doubt the concept of `let` has
> > changed all that much since 1958.  ;)
>
> Since 1958, named let has been added.  Also let* and letrec .
>
> --
> David Kastrup
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: scheme with Frescobaldi

2018-06-27 Thread David Kastrup
Aaron Hill  writes:

> On 2018-06-27 08:14, Simon Albrecht wrote:
>> On 26.06.2018 03:02, Aaron Hill wrote:
>>> Here is the reference on `let` for Guile:
>>>
>>> https://www.gnu.org/software/guile/manual/html_node/Local-Bindings.html#Local-Bindings
>>
>> I guess for the time being we should stick with the Guile 1.8 manual:
>> 
>
> Ah, sorry about that.  The new docs are always what shows up in a web
> search, and I forgot to manually adjust for the older version of Guile
> that LilyPond uses.  That said, I doubt the concept of `let` has
> changed all that much since 1958.  ;)

Since 1958, named let has been added.  Also let* and letrec .

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: scheme with Frescobaldi

2018-06-27 Thread Aaron Hill

On 2018-06-27 08:14, Simon Albrecht wrote:

On 26.06.2018 03:02, Aaron Hill wrote:

Here is the reference on `let` for Guile:

https://www.gnu.org/software/guile/manual/html_node/Local-Bindings.html#Local-Bindings


I guess for the time being we should stick with the Guile 1.8 manual:



Ah, sorry about that.  The new docs are always what shows up in a web 
search, and I forgot to manually adjust for the older version of Guile 
that LilyPond uses.  That said, I doubt the concept of `let` has changed 
all that much since 1958.  ;)


-- Aaron Hill

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: scheme with Frescobaldi

2018-06-27 Thread Simon Albrecht

On 26.06.2018 03:02, Aaron Hill wrote:

Here is the reference on `let` for Guile:

https://www.gnu.org/software/guile/manual/html_node/Local-Bindings.html#Local-Bindings


I guess for the time being we should stick with the Guile 1.8 manual:


Best, Simon

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: scheme with Frescobaldi

2018-06-27 Thread Freeman Gilmore
​

On Wed, Jun 27, 2018 at 2:39 AM, Urs Liska  wrote:

[And please allow me a plug: you may find rewarding to have a look at
https://scheme-book.ursliska.de, which is far from complete but aims at
giving a slow-paced and detailed introduction specifically from a LilyPond
perspective]


> ​This is what I have been looking for.   Is there a PDF?​
>
>
>
> No, and currently my (Gitbook) build system is broken, so I can't even
> upload updates. But the content is available in a bunch of Markdown files,
> and I'd be ready to move on to a new system, possibly Pandoc-based. If
> someone has a good suggestion for a tool/set-up to create PDF documents and
> HTML sites from Markdown content (with LilyPond syntax highlighting and
> inclusion of LilyPond scores) I'd be glad to look into it.
> ​
>

That would be nice, wish I could help!​



> ​Check your ​URL in this:
> Last part of https://scheme-book.ursliska.de/scheme/expressions.html
> "You can and should for now ignore everything you don't know about that
> (we'll soon cover it in the chapter about variable binding
> ) but simply realize
> that within that “mess” we have inserted ..."
>
>
> Well, like with Wiki systems you can enter links to pages that don't exist
> yet. So that's simply part of the incompleteness of the "book", and I can't
> do anything about it right now.
>
​The URL *does exist* if you remove .html it should works fine​

​.​

Thank you, ƒg​

>
> Best
> Urs
>
>
> ​Thank you, ƒg
> ​
>
> Best
> Urs
>
>
> ​Thank you,
> ƒg​
>
>
>>
>> ​​
>>
>>
>>
>
>
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: scheme with Frescobaldi

2018-06-26 Thread Urs Liska



Am 27.06.2018 um 07:34 schrieb Freeman Gilmore:




Thanks Urs:

That worked.   Problem was that I did not know that the
results would be displayed in the log window.   The
tutorial I am using had some example like  (+ 1 2 3) =>  and
I was expecting 6 in the same window on the next line when I
compiled.


This is what one refers to as a REPL (read-eval-print-loop),
which is what LilyPond's Scheme sandbox does.


This may be what you mean by " but no immediate expression
evaluation".


Yes. Frescobaldi deals with LilyPond *files*, not an
immediate expression evaluation.


Is => valid in guile?


No.


 How would I display the results of (+ 1 2 3), at this point
of the tutorial it just says  "(+ 1 2 3)  => 6"?


When a tutorial writes "=>" it means: "You type in '(+ 1 2
3)', and the REPL will display '6'. So "=>" isn't a
syntactical construct but a typographical convention for "the
expression to the left evaluates to the datum on the right".

Tutorials usually want you to learn from this immediate
evaluation, and in Frescobaldi you have to always do that
extra step to display something. But in general it's worth
the effort, and I do that 90% of the time when I want to try
something out or learn more about Scheme.

​​
For displaying values you can use #(display) or #(ly:message
"Some value: ~a" data) (to start with ...)

HTH
Urs



Thank you,
ƒg​


​Urs:

In you first example #(let...) what function does 'let'
preform?    From your examples in "​For displaying values you can
use #(display) or #(ly:message "Some value: ~a" data) (to start
with ...)", could you please give me examples of each?   I need
this to study the tutorial using Frescobaldi.


OK, it probably wasn't such a good idea to use non-atomic examples.
Let me try to put it another way: what you have in Frescobaldi is
a LilyPond file. This file may include Scheme code, and LilyPond
even works if there is *only* Scheme code in the file and no score
is even generated. That way you can use LilyPond and Frescobaldi
as a tool to experiment with Scheme code.

​When I started this post​ I was hoping that Scheme work with out score.


The way to include Scheme in LilyPond is the '#'. Whenever
LilyPond encounters this hash it will have the immediately
following expression evaluated by Scheme. Essentially the
expression is replaced by the resulting value.

​This helped​
​a lot.​


What you have already noticed is that this Scheme code is not
evaluated immediately (as is done on a REPL and what your tutorial
seems to assume), but only when compiling the LilyPond file.

One more thing to understand is the following: any Scheme
expression *evaluates to* something (like (+ 1 2 3) evaluates to
6). In a REPL this value is displayed but in LilyPond/Frescobaldi
it is not. If you write #(+ 1 2 3) in a LilyPond file it *will*
evaluate to 6 but it only has the effect of placing that value 6
in the LilyPond file, which will have no effect at all.

​I figured this​.


The additional effort you have to make is explicitly print any
value you want to inspect to the log window. Scheme provides some
functions for that purpose: display, print, pretty-print, and more.
​​
  #(define my-var 12)
  #(display my-var)
will print '12' to the log window,
  #(display (+ 1 2 3))
will print '6'

​Now this helped because I was making it work with #(let...; above is 
much simpler.



Note that display won't add a line break, so when you want to see
more than one value you'll want to add #(newline) expressions in
between.

​Read that sum place.​


A final remark: there are many Scheme implementations (or
dialects) around, with more or less subtle differences. When you
use LilyPond you have a very specific dialect available (the Guile
implementation in its version 1.8), plus when starting up LilyPond
a number of extra Guile modules and many LilyPond features are
automatically added. This means that when you follow a "Scheme
tutorial" not necessarily everything will match what you find in
LilyPond.

[And please allow me a plug: you may find rewarding to have a look
at https://scheme-book.ursliska.de
, which is far from complete but
aims at giving a slow-paced and detailed introduction specifically
from a LilyPond perspective]

​This is what I have been looking for.   Is there a PDF?    ​


No, and currently my (Gitbook) build system is broken, so I can't even 
upload updates. But the content is available in a bunch of Markdown 
files, and I'd be ready to move on to a new system, possibly 
Pandoc-based. If someo

Re: scheme with Frescobaldi

2018-06-26 Thread Freeman Gilmore
>
>> Thanks Urs:
>>
>> That worked.   Problem was that I did not know that the results would be
>> displayed in the log window.   The tutorial I am using had some example
>> like  (+ 1 2 3)  =>  and I was expecting 6 in the same window on the next
>> line when I compiled.
>>
>>
>> This is what one refers to as a REPL (read-eval-print-loop), which is
>> what LilyPond's Scheme sandbox does.
>>
>>   This may be what you mean by " but no immediate expression
>> evaluation".
>>
>>
>> Yes. Frescobaldi deals with LilyPond *files*, not an immediate expression
>> evaluation.
>>
>> Is => valid in guile?
>>
>>
>> No.
>>
>>  How would I display the results of (+ 1 2 3), at this point of the
>> tutorial it just says  "(+ 1 2 3)  =>   6"?
>>
>>
>> When a tutorial writes "=>" it means: "You type in '(+ 1 2 3)', and the
>> REPL will display '6'. So "=>" isn't a syntactical construct but a
>> typographical convention for "the expression to the left evaluates to the
>> datum on the right".
>>
>> Tutorials usually want you to learn from this immediate evaluation, and
>> in Frescobaldi you have to always do that extra step to display something.
>> But in general it's worth the effort, and I do that 90% of the time when I
>> want to try something out or learn more about Scheme.
>>
>> ​​
>> For displaying values you can use #(display) or #(ly:message "Some value:
>> ~a" data) (to start with ...)
>>
>> HTH
>> Urs
>>
>>
>> Thank you,
>> ƒg​
>>
>> ​Urs:
>
> In you first example #(let...) what function does 'let' preform?From
> your examples in "​For displaying values you can use #(display) or
> #(ly:message "Some value: ~a" data) (to start with ...)", could you
> please give me examples of each?   I need this to study the tutorial using
> Frescobaldi.
>
>
> OK, it probably wasn't such a good idea to use non-atomic examples.
> Let me try to put it another way: what you have in Frescobaldi is a
> LilyPond file. This file may include Scheme code, and LilyPond even works
> if there is *only* Scheme code in the file and no score is even generated.
> That way you can use LilyPond and Frescobaldi as a tool to experiment with
> Scheme code.
>
​When I started this post​ I was hoping that Scheme work with out score.

>
> The way to include Scheme in LilyPond is the '#'. Whenever LilyPond
> encounters this hash it will have the immediately following expression
> evaluated by Scheme. Essentially the expression is replaced by the
> resulting value.
>
​This helped​

​a lot.​

>
> What you have already noticed is that this Scheme code is not evaluated
> immediately (as is done on a REPL and what your tutorial seems to assume),
> but only when compiling the LilyPond file.
>
> One more thing to understand is the following: any Scheme expression
> *evaluates to* something (like (+ 1 2 3) evaluates to 6). In a REPL this
> value is displayed but in LilyPond/Frescobaldi it is not. If you write #(+
> 1 2 3) in a LilyPond file it *will* evaluate to 6 but it only has the
> effect of placing that value 6 in the LilyPond file, which will have no
> effect at all.
>
​I figured this​.

>
> The additional effort you have to make is explicitly print any value you
> want to inspect to the log window. Scheme provides some functions for that
> purpose: display, print, pretty-print, and more.
> ​​
>   #(define my-var 12)
>   #(display my-var)
> will print '12' to the log window,
>   #(display (+ 1 2 3))
> will print '6'
>
​Now this helped because I was making it work with #(let...; above is much
simpler.

>
> Note that display won't add a line break, so when you want to see more
> than one value you'll want to add #(newline) expressions in between.
>
​Read that sum place.​


>
> A final remark: there are many Scheme implementations (or dialects)
> around, with more or less subtle differences. When you use LilyPond you
> have a very specific dialect available (the Guile implementation in its
> version 1.8), plus when starting up LilyPond a number of extra Guile
> modules and many LilyPond features are automatically added. This means that
> when you follow a "Scheme tutorial" not necessarily everything will match
> what you find in LilyPond.
>
> [And please allow me a plug: you may find rewarding to have a look at
> https://scheme-book.ursliska.de, which is far from complete but aims at
> giving a slow-paced and detailed introduction specifically from a LilyPond
> perspective]
>
​This is what I have been looking for.   Is there a PDF?​

​Check your ​URL in this:
Last part of https://scheme-book.ursliska.de/scheme/expressions.html
"You can and should for now ignore everything you don't know about that
(we'll soon cover it in the chapter about variable binding
) but simply realize
that within that “mess” we have inserted ..."

​Thank you, ƒg
​

Best
Urs


​Thank you,
ƒg​


>
> ​​
>
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailma

Re: scheme with Frescobaldi

2018-06-26 Thread Freeman Gilmore
​

On Tue, Jun 26, 2018 at 12:24 AM, Andrew Bernard 
wrote:

> Hi Freeman,
>
> I'm not understanding this thread. For Scheme development or learning, why
> wouldn't you use a command line REPL, such as the one provided with guile?
> Are you trying to use Frescobaldi as some sort of IDE? That seems dubious
> to me, and not at all fluent or easy.
>
> Andrew
>

​
Thanks Andrew:

I never down loaded REPL   I did not know it was part of Lilypond.   I do
not like Command Line and I wanted to work with something closer to
Lilypond if passable.   I wanted a better editor and was hoping Frescobaldi
would do scheme as well.   I do not mind a little extra work because it
will get me use to working with Frescobaldi.   Yes, Frescobaldi is working
as a IDE for me.​

Thank you, ƒg
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: scheme with Frescobaldi

2018-06-26 Thread Urs Liska

Hi Andrew,


Am 26.06.2018 um 06:24 schrieb Andrew Bernard:

Hi Freeman,

I'm not understanding this thread. For Scheme development or learning, 
why wouldn't you use a command line REPL, such as the one provided 
with guile? Are you trying to use Frescobaldi as some sort of IDE? 
That seems dubious to me, and not at all fluent or easy.


I disagree with that.
First when having a working LilyPond installation you don't have a Guile 
REPL available (at least not that I know of). What you *do* have is 
"lilypond scheme-sandbox", which has the significant advantage of 
providing exactly the environment as in a LilyPond file. But I must say 
this is a terrible environment and not really usable for anything beyond 
simple one-line expressions.


Therefore I agree that Frescobaldi is a very suitable environment to 
learn and experiment with LilyPond-targeted Scheme code, and the little 
extra effort to print to the log is pretty much neglectable.


Urs



Andrew




___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: scheme with Frescobaldi

2018-06-26 Thread Urs Liska



Am 26.06.2018 um 02:25 schrieb Freeman Gilmore:

​

On Mon, Jun 25, 2018 at 4:04 PM, Urs Liska > wrote:


CCing to the list.


Am 25.06.2018 um 21:47 schrieb Freeman Gilmore:



On Mon, Jun 25, 2018 at 9:29 AM, Urs Liska mailto:li...@openlilylib.org>> wrote:

Hi Freeman,


Am 25.06.2018 um 15:03 schrieb Freeman Gilmore:

​Can scheme alone be used in Frescobaldi (or scheme sandbox)?



It's not clear to me what you want ot achieve.

The Scheme sandbox is surely not available in Frescobaldi.

You can of course write LilyPond files that exclusively
contain Scheme code, and that code doesn't have to be related
to scores. But at least the entry point must be LilyPond
language.

Try this file:

\version "2.19.80"

#(let
   ((something 'something-else))
   (display something)
   (newline)
   (display something)(display something))

It will do in Scheme what you tell it, and from there you
have access to anything you can do with Guile Scheme (and the
LilyPond environment set up automatically).

That will give you syntax highlighting and auto-indentation
from Frescobaldi (much better than the Scheme sandbox) but no
immediate expression evaluation.

HTH
Urs


 thank you,
ƒg


​
Thanks Urs:

That worked.   Problem was that I did not know that the results
would be displayed in the log window.   The tutorial I am using
had some example like  (+ 1 2 3)  =>  and I was expecting 6 in
the same window on the next line when I compiled.


This is what one refers to as a REPL (read-eval-print-loop), which
is what LilyPond's Scheme sandbox does.


  This may be what you mean by " but no immediate expression
evaluation".


Yes. Frescobaldi deals with LilyPond *files*, not an immediate
expression evaluation.


Is => valid in guile?


No.


 How would I display the results of (+ 1 2 3), at this point of
the tutorial it just says  "(+ 1 2 3)  =>   6"?


When a tutorial writes "=>" it means: "You type in '(+ 1 2 3)',
and the REPL will display '6'. So "=>" isn't a syntactical
construct but a typographical convention for "the expression to
the left evaluates to the datum on the right".

Tutorials usually want you to learn from this immediate
evaluation, and in Frescobaldi you have to always do that extra
step to display something. But in general it's worth the effort,
and I do that 90% of the time when I want to try something out or
learn more about Scheme.

​​
For displaying values you can use #(display) or #(ly:message "Some
value: ~a" data) (to start with ...)

HTH
Urs



Thank you,
ƒg​


​Urs:

In you first example #(let...) what function does 'let' preform?    
From your examples in "​For displaying values you can use #(display) 
or #(ly:message "Some value: ~a" data) (to start with ...)", could you 
please give me examples of each?   I need this to study the tutorial 
using Frescobaldi.


OK, it probably wasn't such a good idea to use non-atomic examples.
Let me try to put it another way: what you have in Frescobaldi is a 
LilyPond file. This file may include Scheme code, and LilyPond even 
works if there is *only* Scheme code in the file and no score is even 
generated. That way you can use LilyPond and Frescobaldi as a tool to 
experiment with Scheme code.


The way to include Scheme in LilyPond is the '#'. Whenever LilyPond 
encounters this hash it will have the immediately following expression 
evaluated by Scheme. Essentially the expression is replaced by the 
resulting value.


What you have already noticed is that this Scheme code is not evaluated 
immediately (as is done on a REPL and what your tutorial seems to 
assume), but only when compiling the LilyPond file.


One more thing to understand is the following: any Scheme expression 
*evaluates to* something (like (+ 1 2 3) evaluates to 6). In a REPL this 
value is displayed but in LilyPond/Frescobaldi it is not. If you write 
#(+ 1 2 3) in a LilyPond file it *will* evaluate to 6 but it only has 
the effect of placing that value 6 in the LilyPond file, which will have 
no effect at all.


The additional effort you have to make is explicitly print any value you 
want to inspect to the log window. Scheme provides some functions for 
that purpose: display, print, pretty-print, and more.

  #(define my-var 12)
  #(display my-var)
will print '12' to the log window,
  #(display (+ 1 2 3))
will print '6'

Note that display won't add a line break, so when you want to see more 
than one value you'll want to add #(newline) expressions in between.


A final remark: there are many Scheme implementations (or dialects) 
around, with more or less subtle differences. When you use LilyPond you 
have a very specif

Re: scheme with Frescobaldi

2018-06-25 Thread Andrew Bernard
Hi Freeman,

I'm not understanding this thread. For Scheme development or learning, why
wouldn't you use a command line REPL, such as the one provided with guile?
Are you trying to use Frescobaldi as some sort of IDE? That seems dubious
to me, and not at all fluent or easy.

Andrew
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: scheme with Frescobaldi

2018-06-25 Thread Freeman Gilmore
​

On Mon, Jun 25, 2018 at 9:02 PM, Aaron Hill 
wrote:

> On 2018-06-25 17:25, Freeman Gilmore wrote:
>
>> On Mon, Jun 25, 2018 at 9:29 AM, Urs Liska  wrote:
>>>
 Try this file:

 \version "2.19.80"

 #(let
   ((something 'something-else))
   (display something)
   (newline)
   (display something)(display something))

>>>
>> In you first example #(let...) what function does 'let' preform?
>>
>
> Here is the reference on `let` for Guile:
>
> https://www.gnu.org/software/guile/manual/html_node/Local-Bi
> ndings.html#Local-Bindings
>
> Without repeating verbatim what is there, `let` is a way of defining
> locally-scoped variables.
>
> In the example above, `something` is being defined as `'something-else`,
> and it is being referenced later in the function body several times.  But
> as a local variable, `something` is ephemeral and will no longer be valid
> outside of the scope of the let-block body.  Consider:
>
> 
>   #(let
> ((a 1) (b 2))
> (display (+ a b))#! should output 3 !#
> (let
>  ((a b) (c 3))
>  (display (+ a c))   #! should output 5 !#
> )
> (display a)  #! should output 1 !#
> #!(display c)!#  #! error: unbound variable c !#
>)
> 
>
> The inner let here redefines `a` while also defining `c`.  Outside of its
> body, the original value of `a` is effectively restored but then `c` is no
> longer bound so you cannot refer to it.
>
> Hope that helps,
>
> -- Aaron Hill
>

​Thanks Aaron​:
​The example was very clear. Now I am reading the reference next.

Thank you, ƒg

>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: scheme with Frescobaldi

2018-06-25 Thread Aaron Hill

On 2018-06-25 17:25, Freeman Gilmore wrote:
On Mon, Jun 25, 2018 at 9:29 AM, Urs Liska  
wrote:

Try this file:

\version "2.19.80"

#(let
  ((something 'something-else))
  (display something)
  (newline)
  (display something)(display something))


In you first example #(let...) what function does 'let' preform?


Here is the reference on `let` for Guile:

https://www.gnu.org/software/guile/manual/html_node/Local-Bindings.html#Local-Bindings

Without repeating verbatim what is there, `let` is a way of defining 
locally-scoped variables.


In the example above, `something` is being defined as `'something-else`, 
and it is being referenced later in the function body several times.  
But as a local variable, `something` is ephemeral and will no longer be 
valid outside of the scope of the let-block body.  Consider:



  #(let
((a 1) (b 2))
(display (+ a b))#! should output 3 !#
(let
 ((a b) (c 3))
 (display (+ a c))   #! should output 5 !#
)
(display a)  #! should output 1 !#
#!(display c)!#  #! error: unbound variable c !#
   )


The inner let here redefines `a` while also defining `c`.  Outside of 
its body, the original value of `a` is effectively restored but then `c` 
is no longer bound so you cannot refer to it.


Hope that helps,

-- Aaron Hill

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: scheme with Frescobaldi

2018-06-25 Thread Freeman Gilmore
​

On Mon, Jun 25, 2018 at 4:04 PM, Urs Liska  wrote:

> CCing to the list.
>
> Am 25.06.2018 um 21:47 schrieb Freeman Gilmore:
>
>
>
> On Mon, Jun 25, 2018 at 9:29 AM, Urs Liska  wrote:
>
>> Hi Freeman,
>>
>> Am 25.06.2018 um 15:03 schrieb Freeman Gilmore:
>>
>> ​Can scheme alone be used in Frescobaldi (or scheme sandbox)?
>>
>>
>> It's not clear to me what you want ot achieve.
>>
>> The Scheme sandbox is surely not available in Frescobaldi.
>>
>> You can of course write LilyPond files that exclusively contain Scheme
>> code, and that code doesn't have to be related to scores. But at least the
>> entry point must be LilyPond language.
>>
>> Try this file:
>>
>> \version "2.19.80"
>>
>> #(let
>>   ((something 'something-else))
>>   (display something)
>>   (newline)
>>   (display something)(display something))
>>
>> It will do in Scheme what you tell it, and from there you have access to
>> anything you can do with Guile Scheme (and the LilyPond environment set up
>> automatically).
>>
>> That will give you syntax highlighting and auto-indentation from
>> Frescobaldi (much better than the Scheme sandbox) but no immediate
>> expression evaluation.
>>
>> HTH
>> Urs
>>
>>  thank you,
>> ƒg
>>
>> ​
> Thanks Urs:
>
> That worked.   Problem was that I did not know that the results would be
> displayed in the log window.   The tutorial I am using had some example
> like  (+ 1 2 3)  =>  and I was expecting 6 in the same window on the next
> line when I compiled.
>
>
> This is what one refers to as a REPL (read-eval-print-loop), which is what
> LilyPond's Scheme sandbox does.
>
>   This may be what you mean by " but no immediate expression evaluation".
>
>
> Yes. Frescobaldi deals with LilyPond *files*, not an immediate expression
> evaluation.
>
> Is => valid in guile?
>
>
> No.
>
>  How would I display the results of (+ 1 2 3), at this point of the
> tutorial it just says  "(+ 1 2 3)  =>   6"?
>
>
> When a tutorial writes "=>" it means: "You type in '(+ 1 2 3)', and the
> REPL will display '6'. So "=>" isn't a syntactical construct but a
> typographical convention for "the expression to the left evaluates to the
> datum on the right".
>
> Tutorials usually want you to learn from this immediate evaluation, and in
> Frescobaldi you have to always do that extra step to display something. But
> in general it's worth the effort, and I do that 90% of the time when I want
> to try something out or learn more about Scheme.
>
> ​​
> For displaying values you can use #(display) or #(ly:message "Some value:
> ~a" data) (to start with ...)
>
> HTH
> Urs
>
>
> Thank you,
> ƒg​
>
> ​Urs:

In you first example #(let...) what function does 'let' preform?From
your examples in "​For displaying values you can use #(display) or
#(ly:message "Some value: ~a" data) (to start with ...)", could you please
give me examples of each?   I need this to study the tutorial using
Frescobaldi.

​Thank you,
ƒg​


>
> ​​
>
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: scheme with Frescobaldi

2018-06-25 Thread Urs Liska

CCing to the list.


Am 25.06.2018 um 21:47 schrieb Freeman Gilmore:



On Mon, Jun 25, 2018 at 9:29 AM, Urs Liska > wrote:


Hi Freeman,


Am 25.06.2018 um 15:03 schrieb Freeman Gilmore:

​Can scheme alone be used in Frescobaldi (or scheme sandbox)?



It's not clear to me what you want ot achieve.

The Scheme sandbox is surely not available in Frescobaldi.

You can of course write LilyPond files that exclusively contain
Scheme code, and that code doesn't have to be related to scores.
But at least the entry point must be LilyPond language.

Try this file:

\version "2.19.80"

#(let
   ((something 'something-else))
   (display something)
   (newline)
   (display something)(display something))

It will do in Scheme what you tell it, and from there you have
access to anything you can do with Guile Scheme (and the LilyPond
environment set up automatically).

That will give you syntax highlighting and auto-indentation from
Frescobaldi (much better than the Scheme sandbox) but no immediate
expression evaluation.

HTH
Urs


 thank you,
ƒg


​
Thanks Urs:

That worked.   Problem was that I did not know that the results would 
be displayed in the log window.   The tutorial I am using had some 
example like  (+ 1 2 3) =>  and I was expecting 6 in the same window 
on the next line when I compiled.


This is what one refers to as a REPL (read-eval-print-loop), which is 
what LilyPond's Scheme sandbox does.



This may be what you mean by " but no immediate expression evaluation".


Yes. Frescobaldi deals with LilyPond *files*, not an immediate 
expression evaluation.



Is => valid in guile?


No.

 How would I display the results of (+ 1 2 3), at this point of the 
tutorial it just says  "(+ 1 2 3) =>   6"?


When a tutorial writes "=>" it means: "You type in '(+ 1 2 3)', and the 
REPL will display '6'. So "=>" isn't a syntactical construct but a 
typographical convention for "the expression to the left evaluates to 
the datum on the right".


Tutorials usually want you to learn from this immediate evaluation, and 
in Frescobaldi you have to always do that extra step to display 
something. But in general it's worth the effort, and I do that 90% of 
the time when I want to try something out or learn more about Scheme.


For displaying values you can use #(display) or #(ly:message "Some 
value: ~a" data) (to start with ...)


HTH
Urs



Thank you,
ƒg​



​​

___
lilypond-user mailing list
lilypond-user@gnu.org 
https://lists.gnu.org/mailman/listinfo/lilypond-user




___
lilypond-user mailing list
lilypond-user@gnu.org 
https://lists.gnu.org/mailman/listinfo/lilypond-user





___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: scheme with Frescobaldi

2018-06-25 Thread Urs Liska

Hi Freeman,


Am 25.06.2018 um 15:03 schrieb Freeman Gilmore:

​Can scheme alone be used in Frescobaldi (or scheme sandbox)?



It's not clear to me what you want ot achieve.

The Scheme sandbox is surely not available in Frescobaldi.

You can of course write LilyPond files that exclusively contain Scheme 
code, and that code doesn't have to be related to scores. But at least 
the entry point must be LilyPond language.


Try this file:

\version "2.19.80"

#(let
  ((something 'something-else))
  (display something)
  (newline)
  (display something)(display something))

It will do in Scheme what you tell it, and from there you have access to 
anything you can do with Guile Scheme (and the LilyPond environment set 
up automatically).


That will give you syntax highlighting and auto-indentation from 
Frescobaldi (much better than the Scheme sandbox) but no immediate 
expression evaluation.


HTH
Urs


 thank you,
ƒg


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


scheme with Frescobaldi

2018-06-25 Thread Freeman Gilmore
​Can scheme alone be used in Frescobaldi (or scheme sandbox)?

 thank you,
ƒg
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user