Re: Can't refer to variable directly after defining it

2017-04-24 Thread Dmytro O. Redchuk
% -- 8< --
foo = {c' c' c' c'}
{ \foo }
% -- 8< --

--- is ok.


soprano = { \soprano \anotherSoprano }
--- is ok also.

I mean:

% -- 8< --
soprano = \lyricmode {
  la -- la -- la
}

refrain = \lyricmode {
  ha -- ha -- ha
}

soprano = { \soprano \refrain }
% -- 8< --

--- will also be ok.

2017-04-23 0:50 GMT+03:00  :
> 4On 04/22/17 23:47, Thomas Morley wrote:
>>
>> The reason for it: The parser needs to check whether there is
>> something else which needs to be added to the definition of 'foo',
>> (most common example for those stuff is 'addlyrics') or, something
>> else makes clear the declaration of 'foo' is complete.
>
>
> Ah, that makes sense. `fff = a''4 \fff` is a bit ambigous.
>
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user



-- 
  Dmytro O. Redchuk

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


Re: Can't refer to variable directly after defining it

2017-04-22 Thread caagr98

4On 04/22/17 23:47, Thomas Morley wrote:

The reason for it: The parser needs to check whether there is
something else which needs to be added to the definition of 'foo',
(most common example for those stuff is 'addlyrics') or, something
else makes clear the declaration of 'foo' is complete.


Ah, that makes sense. `fff = a''4 \fff` is a bit ambigous.

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


Re: Can't refer to variable directly after defining it

2017-04-22 Thread Thomas Morley
2017-04-22 23:32 GMT+02:00  <caag...@gmail.com>:
> For some reason, it seems I can't refer to a variable directly after
> defining it. As soon as I do /anything/ else, it works, but `foo={...} \foo`
> gives errors.
>
> ```
> $ cat bug.ly
> \version "2.18.2"
> foo = {c' c' c' c'}
> % bar = {d' d' d' d'}
> % {e' e' e' e'}
> % #foo
> \foo
> $ lilypond bug.ly
> GNU LilyPond 2.18.2
> Processing `bug.ly'
> Parsing...
> bug.ly:6:1: error: unknown escaped string: `\foo'
>
> \foo
> bug.ly:6:5: error: syntax error, unexpected end of input
> \foo
>
> fatal error: failed files: "bug"
> ```
>
> Uncommenting either of the three commented-out lines makes it work, all with
> the same resulting PDF.

The reason for it: The parser needs to check whether there is
something else which needs to be added to the definition of 'foo',
(most common example for those stuff is 'addlyrics') or, something
else makes clear the declaration of 'foo' is complete.

So, in your example 'foo' is used before the parser "understood" it's
definition.

Not sure it's a bug, more a consequence of the wished parser-behaviour.

>
> I'm currently using `\void {}` as a workaround, but I'd obviously prefer not
> having to do that.



Any new declaration will work:

For example:

\new Voice \foo
will work or separate with
#(begin)

David could explain more detailed.

hth a bit,
  Harm

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


Can't refer to variable directly after defining it

2017-04-22 Thread caagr98
For some reason, it seems I can't refer to a variable directly after 
defining it. As soon as I do /anything/ else, it works, but `foo={...} 
\foo` gives errors.


```
$ cat bug.ly
\version "2.18.2"
foo = {c' c' c' c'}
% bar = {d' d' d' d'}
% {e' e' e' e'}
% #foo
\foo
$ lilypond bug.ly
GNU LilyPond 2.18.2
Processing `bug.ly'
Parsing...
bug.ly:6:1: error: unknown escaped string: `\foo'

\foo
bug.ly:6:5: error: syntax error, unexpected end of input
\foo

fatal error: failed files: "bug"
```

Uncommenting either of the three commented-out lines makes it work, all 
with the same resulting PDF.


I'm currently using `\void {}` as a workaround, but I'd obviously prefer 
not having to do that.



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