Returns a FoscScheme.
Scheme
!!!NB:
abjad: Scheme(1, 2, 3, force_quotes=True, verbatim=False)
fosc: FoscScheme(1, 2, 3).forceQuotes_(true).isVerbatim_(false);
Examples from http://abjad.mbrsi.org/api/tools/schemetools/Scheme.html
| formatEmbeddedSchemeValue | Formats value as an embedded Scheme value. |
| formatSchemeValue | Formats value as Scheme would. |
| makeSpacingVector | //!!! DEPRECATE |
| forceQuotes_ | Is true when quotes should be forced in output. |
| format | |
| isVerbatim_ | Is true when formatting should format value absolutely verbatim. Whitespace, |
| quoting_ | Sets Scheme quoting string. |
A Scheme boolean value
a = FoscScheme(true);
a.format;##tExample 2. A nested Scheme expession
a = FoscScheme(['left', [1, 2, false]], ['right', [1, 2, 3.3]]);
a.format;#((left (1 2 #f)) (right (1 2 3.3)))Example 3. A variable-length argument
Scheme wraps nested variable-length arguments in a tuple.
a = FoscScheme(1, 2, 3);
b = FoscScheme([1, 2, 3]);
format(a) == format(b);trueExample 4. A quoted Scheme expression
a = FoscScheme([1, 2, 3]).quoting_("'#");
a.format;#'#(1 2 3)Example 5. A Scheme expression with forced quotes
a = FoscScheme('nospaces').forceQuotes_(true);
a.format;#"nospaces"Example 6. A Scheme expression of LilyPond functions
Use this in certain override situations when LilyPond’s Scheme interpreter treats unquoted strings as symbols instead of strings. The string must contain no whitespace for this to work.
x = "tuplet-number::append-note-wrapper";
y = "tuplet-number::calc-denominator-text";
a = FoscScheme("4").forceQuotes_(true);
b = FoscScheme(x, y, a);
b.format;#(tuplet-number::append-note-wrapper tuplet-number::calc-denominator-text "4")Example 7. A Scheme lambda expression of LilyPond function that takes a markup with a quoted string argument.
Setting verbatim to true causes the expression to format exactly as-is without modifying quotes or whitespace:
x = "(lambda (grob) (grob-interpret-markup grob' #{ \\markup \\musicglyph #\"noteheads.s0harmonic\" #}))";
a = FoscScheme(x).isVerbatim_(true);
a.format;#(lambda (grob) (grob-interpret-markup grob' #{ \markup \musicglyph #"noteheads.s0harmonic" #}))Formats value as an embedded Scheme value.
Example
FoscScheme.formatEmbeddedSchemeValue(FoscOrdinalConstant('x', -1, \left));#leftFormats value as Scheme would.
Example
FoscScheme.formatSchemeValue(1);1FoscScheme.formatSchemeValue("foo\"bar", isVerbatim: false);foo\"barFoscScheme.formatSchemeValue("foo\"bar", isVerbatim: true);foo"barFoscScheme.formatSchemeValue("foobar");foobarFoscScheme.formatSchemeValue('foo bar');"foo bar"FoscScheme.formatSchemeValue(true);#tFoscScheme.formatSchemeValue([\one, "two", \three, "four", 5, 7]);(one two three four 5 7)FoscScheme.formatSchemeValue();#fFoscScheme.formatSchemeValue("four", forceQuotes: true);"four"FoscScheme.formatSchemeValue("#1-finger", isVerbatim: true);#1-fingerFoscScheme.formatSchemeValue("#1-finger", isVerbatim: false);"#1-finger"m = FoscMarkup("\\bold { over pressure }");
FoscScheme.formatEmbeddedSchemeValue(m);\markup { "\bold { over pressure }" }//!!! DEPRECATE //!!! use FoscSchemeSpacingVector instead
Example
a = FoscScheme.makeSpacingVector(0, 0, 12);
a.format;#'((basic-distance . 0) (minimum-distance . 0) (padding . 12) (stretchability . 0))Is true when quotes should be forced in output.
Is true when formatting should format value absolutely verbatim. Whitespace, quotes, and all other parts of value are left intact.
Sets Scheme quoting string.