From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/112201 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Rudd, Kevin" Newsgroups: gmane.comp.tex.context Subject: MP keyword function: string parameters no longer accept string variables directly Date: Wed, 21 Jul 2021 16:51:53 +0000 Message-ID: <0604A082-3947-4F0A-B31D-BB72F96F4C37@lps.umd.edu> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3063877540289848508==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3121"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "Rudd, Kevin" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Jul 21 18:52:55 2021 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m6FSp-0000bj-R6 for gctc-ntg-context-518@m.gmane-mx.org; Wed, 21 Jul 2021 18:52:55 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 62C4D285ECA; Wed, 21 Jul 2021 18:52:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Pzl4UpbrWpqt; Wed, 21 Jul 2021 18:52:20 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 9AF0C285EC5; Wed, 21 Jul 2021 18:52:20 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id D6F82285EA9 for ; Wed, 21 Jul 2021 18:52:18 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id s2EjaYj4WOjb for ; Wed, 21 Jul 2021 18:52:17 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=129.2.108.16; helo=smtp.lps.umd.edu; envelope-from=kevin@lps.umd.edu; receiver= Original-Received: from SMTP.lps.umd.edu (smtp.lps.umd.edu [129.2.108.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 8FD56285629 for ; Wed, 21 Jul 2021 18:52:16 +0200 (CEST) Original-Received: from LPS-ExchDB1.lps.umd.edu (129.2.108.17) by SMTP.lps.umd.edu (129.2.108.16) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Wed, 21 Jul 2021 12:52:13 -0400 Original-Received: from LPS-ExchDB1.lps.umd.edu (2002:8102:6c11::8102:6c11) by LPS-ExchDB1.lps.umd.edu (2002:8102:6c11::8102:6c11) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 21 Jul 2021 12:51:53 -0400 Original-Received: from LPS-ExchDB1.lps.umd.edu ([129.2.108.17]) by LPS-ExchDB1.lps.umd.edu ([129.2.108.17]) with mapi id 15.00.1497.012; Wed, 21 Jul 2021 12:51:53 -0400 Thread-Topic: MP keyword function: string parameters no longer accept string variables directly Thread-Index: AQHXflC1fgcoOP3UrUq86GtSkF8Law== Accept-Language: en-US Content-Language: en-US x-mailer: Apple Mail (2.3445.104.21) x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [136.160.90.53] X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:112201 Archived-At: --===============3063877540289848508== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_0604A08239474F0AB31DBB72F96F4C37lpsumdedu_" --_000_0604A08239474F0AB31DBB72F96F4C37lpsumdedu_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi--- Here's another apparent change on the MP side---for keyword functions, stri= ng parameters no longer accept string variables directly. They do seem to r= egister them (hasparameter =3D> true) but don't capture the value (getparam= eter =3D> 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, runni= ng in scaled mode. metapost > trace > metapost > trace > loading metafun for lmtx, including the plain 1.0= 04 base definitions metapost > trace > metapost > trace > >> "string constant fuschia ..." metapost > trace > >> true metapost > trace > >> "fuschia" metapost > trace > >> "string variable fuschia =3D fuschia ..." metapost > trace > >> true metapost > trace > >> 0 metapost > trace > >> "expression containing string variable fuschia= =3D 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 in= t: english/english \startMPdefinitions presetparameters "parameters_Test" [ ] def Test =3D applyparameters "parameters_Test" "do_Test" enddef; def do_Test =3D pushparameters "parameters_Test"; show hasparameter "color"; show getparameter "color"; enddef; \stopMPdefinitions \starttext hello \startalignment[center] \startplacefigure \startMPcode string fuschia; fuschia =3D "fuschia"; show "string constant fuschia ..."; Test [ color =3D "fuschia" ]; show "string variable fuschia =3D " & fuschia & " ..."; Test [ color =3D fuschia ]; show "expression containing string variable fuschia =3D " & fus= chia & " ..."; Test [ color =3D "" & 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 kevin@lps.umd.edu Visiting Research Professor United States Naval Academy rudd@usna.edu --_000_0604A08239474F0AB31DBB72F96F4C37lpsumdedu_ Content-Type: text/html; charset="us-ascii" Content-ID: <4FC2F7D92E428D44832AD7E3361967C5@lps.umd.edu> Content-Transfer-Encoding: quoted-printable Hi---

Here's another apparent change on the MP side---for ke= yword functions, string parameters no longer accept string variables direct= ly. They do seem to register them (hasparameter =3D> true) but don't cap= ture the value (getparameter =3D> 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 =3D fuschia ..."
metapost        > trace > >>= ; true
metapost        > trace > >>= ; 0
metapost        > trace > >>= ; "expression containing string variable fuschia =3D 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 &nb= sp;ver: 2021.07.16 22:03 LMTX  fmt: 2021.7.21  int: english/engli= sh

\startMPdefinitions

    presetparameters "parameters_Test"<= /div>
    [
    ]

    def Test =3D
        applyparameters "parameter= s_Test" "do_Test"
    enddef;

    def do_Test =3D
        pushparameters "parameters= _Test";
        show hasparameter "color&q= uot;;
        show getparameter "color&q= uot;;
    enddef;

\stopMPdefinitions

\starttext

hello

\startalignment[center]
    \startplacefigure
        \startMPcode
            string fuschia; f= uschia =3D "fuschia";

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

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

            show "expres= sion containing string variable fuschia =3D " & fuschia & &quo= t; ...";
            Test [ color =3D =  "" & 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 
kevin@lps.umd.edu

Visiting Research Professor
United States Naval Academy

rudd@usna.edu


--_000_0604A08239474F0AB31DBB72F96F4C37lpsumdedu_-- --===============3063877540289848508== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============3063877540289848508==--