diff options
author | Karl Berry <karl@freefriends.org> | 2013-04-19 23:37:39 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-04-19 23:37:39 +0000 |
commit | 69de3344104bfec286cbe7ea63f03fab58d3c1ec (patch) | |
tree | 14d60f3983479b6a35b024ed1c170d109b86d4e9 /Master/texmf-dist/tex/context/base/core-sys.mkiv | |
parent | 9ff55323bdb88ede985266ee9123bc2cdda58848 (diff) |
context update from cont-tmf.zip of Apr 20 01:16, 11085698 bytes
git-svn-id: svn://tug.org/texlive/trunk@30044 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/core-sys.mkiv')
-rw-r--r-- | Master/texmf-dist/tex/context/base/core-sys.mkiv | 48 |
1 files changed, 35 insertions, 13 deletions
diff --git a/Master/texmf-dist/tex/context/base/core-sys.mkiv b/Master/texmf-dist/tex/context/base/core-sys.mkiv index b65934432de..8f56b6f162c 100644 --- a/Master/texmf-dist/tex/context/base/core-sys.mkiv +++ b/Master/texmf-dist/tex/context/base/core-sys.mkiv @@ -285,9 +285,29 @@ \fi #1#2{#3}} +% new: +% +% \checked\def \whatever#alpha#beta{#alpha + #beta} +% \checked\edef\whatever#alpha#beta{#alpha + #beta} + +\unexpanded\def\unique#1#2% + {\ifdefined#2% + \showmessage\m!system4{\string#2}% + \expandafter#1\expandafter\gobbleddefinition + \else + \expandafter#1% + \fi#2} + +\unexpanded\def\checked#1#2% + {\ifdefined#2% + \showmessage\m!system4{\string#2}% + \fi + #1#2} + % \startluacode -% local contextsprint, ctxcatcodes = context.sprint, tex.ctxcatcodes -% local format, match, gmatch, rep = string.format, string.match, string.gmatch, string.rep +% local formatters = string.formatters +% local contextsprint, ctxcatcodes, prtcatcodes = context.sprint, tex.ctxcatcodes, tex.prtcatcodes +% local match, gmatch, rep = string.match, string.gmatch, string.rep % local empty = { % "single", % "double", @@ -315,22 +335,22 @@ % else % n = 0 % end -% contextsprint(ctxcatcodes,format("\\unexpanded\\def\\%s",cmd)) +% contextsprint(ctxcatcodes,formatters["\\unexpanded\\def\\%s"](cmd)) % if #a > 0 then -% contextsprint(ctxcatcodes,format("{\\do%sempty\\do%s}",empty[#a],cmd)) -% contextsprint(ctxcatcodes,format("\\def\\do%s",cmd)) +% contextsprint(prtcatcodes,formatters["{\\do%sempty\\user_defined_%s}"](empty[#a],cmd)) +% contextsprint(prtcatcodes,formatters["\\def\\user_defined_%s"](cmd)) % for i=1,#a do -% contextsprint(ctxcatcodes,"[#",i,"]") +% contextsprint(ctxcatcodes,formatters["[#%s]"](i)) % end % contextsprint(ctxcatcodes,"{") % for i=#a,1,-1 do -% contextsprint(ctxcatcodes,format("\\if%sargument",check[i])) -% contextsprint(ctxcatcodes,format("\\def\\next{\\dodo%s",cmd)) +% contextsprint(ctxcatcodes,formatters["\\if%sargument"](check[i])) +% contextsprint(prtcatcodes,formatters["\\def\\next{\\user_defined_indeed_%s"](cmd)) % for j=1,#a-i do -% contextsprint(ctxcatcodes,format("[%s]",a[j])) +% contextsprint(ctxcatcodes,formatters["[%s]"](a[j])) % end % for j=1,i do -% contextsprint(ctxcatcodes,format("[#%s]",j)) +% contextsprint(ctxcatcodes,formatters["[#%s]"](j)) % end % contextsprint(ctxcatcodes,"}") % if i == 1 then @@ -340,13 +360,13 @@ % end % end % contextsprint(ctxcatcodes,"\\next}") -% contextsprint(ctxcatcodes,format("\\def\\dodo%s",cmd)) +% contextsprint(prtcatcodes,formatters["\\def\\user_defined_indeed_%s"](cmd)) % for i=1,#a do -% contextsprint(ctxcatcodes,"[#",i,"]") +% contextsprint(ctxcatcodes,formatters["[#%s]"](i)) % end % end % for i=1,n do -% contextsprint(ctxcatcodes,"#",#a+i) +% contextsprint(ctxcatcodes,formatters["#%s"](#a+i)) % end % end % \stopluacode @@ -359,6 +379,8 @@ % \define[me][too][2]\whateverb{#1+#2+#3+#4} % \whateverb[A]{B}{C} % \whateverb[A][B]{C}{D} +% \define[alpha][beta][gamma][delta]\whateverc{#1+#2+#3+#4} +% \whateverc[P][Q] % \stoptext %D This is a checked variant of \type {\getvalue}. |