Hi---

Here's another apparent change on the MP side---for keyword functions, string 
parameters no longer accept string variables directly. They do seem to register 
them (hasparameter => true) but don't capture the value (getparameter => 0). 
Thus:

system          > ConTeXt  ver: 2021.07.16 22:03 LMTX  fmt: 2021.7.21  int: 
english/english

metapost        > trace > This is MPLIB for LuaMetaTeX, version 3.11, running 
in scaled mode.
metapost        > trace >
metapost        > trace > loading metafun for lmtx, including the plain 1.004 
base definitions
metapost        > trace >
metapost        > trace > >> "string constant fuschia ..."
metapost        > trace > >> true
metapost        > trace > >> "fuschia"
metapost        > trace > >> "string variable fuschia = fuschia ..."
metapost        > trace > >> true
metapost        > trace > >> 0
metapost        > trace > >> "expression containing string variable fuschia = 
fuschia ..."
metapost        > trace > >> true
metapost        > trace > >> "fuschia"

String constant: succeeds
String variable: fails
String expression with string variable: succeeds

Here's the MWE:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% system          > ConTeXt  ver: 2021.07.16 22:03 LMTX  fmt: 2021.7.21  int: 
english/english

\startMPdefinitions

    presetparameters "parameters_Test"
    [
    ]

    def Test =
        applyparameters "parameters_Test" "do_Test"
    enddef;

    def do_Test =
        pushparameters "parameters_Test";
        show hasparameter "color";
        show getparameter "color";
    enddef;

\stopMPdefinitions

\starttext

hello

\startalignment[center]
    \startplacefigure
        \startMPcode
            string fuschia; fuschia = "fuschia";

            show "string constant fuschia ...";
            Test [ color = "fuschia" ];

            show "string variable fuschia = " & fuschia & " ...";
            Test [ color =  fuschia  ];

            show "expression containing string variable fuschia = " & fuschia & 
" ...";
            Test [ color =  "" & fuschia  ];

        \stopMPcode
    \stopplacefigure
\stopalignment

goodbye

\stoptext

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


Kevin W. Rudd, Ph.D.
CAPT, USN (Ret)

Computer Architecture & Computer Engineering
Advanced Computing Systems (ACS) Research Program
Laboratory for Physical Sciences (LPS)

443-654-7878
ke...@lps.umd.edu<mailto:ke...@lps.umd.edu>

Visiting Research Professor
United States Naval Academy

r...@usna.edu<mailto:r...@usna.edu>


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to