lilypond-user
[Top][All Lists]
Advanced

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

Re: Complex --evaluate command line option


From: David Kastrup
Subject: Re: Complex --evaluate command line option
Date: Fri, 26 Oct 2018 17:51:07 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Peter Anglea <address@hidden> writes:

> I’m trying to use the -e (--evaluate) option to define a hash, not
> just a single variable. For instance
>
>       lilypond -e ‘((define myhash (make-hash-table))(hashq-set!
> myhash ‘foo “bar”))’ file.ly
>
> The above doesn’t work. I think, obviously, it’s breaking at the
> single quote – ‘foo.

Can you try telling your mail client that it shouldn't mangle quotes?
It's hard to guess what you actually wrote.  At any rate, you have an
extra level of parens that is meaning-changing.  Assuming we are talking
about a Bourne-style shell, you probably want to write something like

lilypond -e "(begin (define myhash (make-hash-table))(hashq-set! myhash 'foo 
\"bar\"))' file.ly

Or, if you prefer the other kind of quotes:

lilypond -e '(begin (define myhash (make-hash-table))(hashq-set! myhash '\''foo 
"bar"))' file.ly

Or, evading the problem

lilypond -e '(begin (define myhash (make-hash-table))(hashq-set! myhash (quote 
foo) "bar"))' file.ly

> I’ve tried escaping it with a backslash (\’foo) and a couple other
> things, but nothing seems to work.

Maybe read up on the quoting conventions of your shell?

> Is it possible to run complex Scheme code in the command line option,
> and/or am I just not escaping special characters the right way?

Probably the latter.

-- 
David Kastrup



reply via email to

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