[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Denemo-devel] Return value of commands that are scripts
From: |
Richard Shann |
Subject: |
Re: [Denemo-devel] Return value of commands that are scripts |
Date: |
Thu, 19 Jun 2014 08:13:14 +0100 |
In the fresh light of day I have got on top of this.
The scripted commands go through scheme_script_callback(), and this
returns true or false depending on if the scheme executed without error
or not. So the d-LilyPondInclude must have been working by inadvertently
causing some syntax error or similar when it returned #f.
Whether we could change the code so that call_out_to_guile() worked
differently and returned the last expression evaluated in the script I'm
not sure - it would require a proper study of schemes throw and catch.
Richard
On Wed, 2014-06-18 at 21:15 +0100, Richard Shann wrote:
> Eloi, Jeremiah - I was surprised to find that if you write a command
> that is a scheme script then the value of the last expression in the
> script is discarded when invoked from scheme, #t is always returned.
> I discovered this because the d-LilyPondInclude command tries to return
> a boolean when passed a parameter ('query . filename) for some string
> filename, depending on whether there is an include for a file of that
> name.
> This stopped working when I re-worked the include stuff, but now I can't
> see how it ever worked. I have just worked around the problem, but I
> can't see where the invocation of scripted commands takes place in the
> newly arranged code, so I don't understand why the last expression in
> the script is not being returned.
> If anyone can shed light on this I would be grateful...
>
> Richard
>
>
>
> _______________________________________________
> Denemo-devel mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/denemo-devel