From 6ab4432f6fe56cc63e53aeb256c89f01a04fb84f Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Wed, 2 Oct 2019 13:21:40 +0200 Subject: 2019-10-02 12:50:00 --- tex/context/base/mkiv/syst-aux.mkxl | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'tex/context/base/mkiv/syst-aux.mkxl') diff --git a/tex/context/base/mkiv/syst-aux.mkxl b/tex/context/base/mkiv/syst-aux.mkxl index c14e03008..7ade250d9 100644 --- a/tex/context/base/mkiv/syst-aux.mkxl +++ b/tex/context/base/mkiv/syst-aux.mkxl @@ -5956,6 +5956,41 @@ % \setmeasure {xx} {1cm} % \setmeasure {xxx}{1cm} +%D \macros +%D {definequantity} +%D +%D These do the same but for numbers. + +\installsystemnamespace{quantity} + +\unexpanded\def\definequantity + {\dodoubleargument\syst_helpers_define_quantity} + +\def\syst_helpers_define_quantity[#1][#2]% + {\expandafter\def\csname\??quantity#1\endcsname{#2}} + +\unexpanded\def\freezequantity + {\dodoubleargument\syst_helpers_freeze_quantity} + +\def\syst_helpers_freeze_quantity[#1][#2]% + {\expandafter\edef\csname\??quantity#1\endcsname{\the\numexpr#2}} + +\unexpanded\def\setquantity #1#2{\expandafter\def \csname\??quantity#1\endcsname{#2}} % quick way +\unexpanded\def\setgquantity#1#2{\expandafter\gdef\csname\??quantity#1\endcsname{#2}} % quick way +\unexpanded\def\setequantity#1#2{\expandafter\edef\csname\??quantity#1\endcsname{\the\numexpr#2}} % quick way +\unexpanded\def\setxquantity#1#2{\expandafter\xdef\csname\??quantity#1\endcsname{\the\numexpr#2}} % quick way + +\def\quantity + {\the\quantitied} + +\def\quantitied#1% + {\numexpr\ifcsname\??quantity#1\endcsname\lastnamedcs\else\zeropoint\fi\relax} + +\def\directquantity#1% + {\the\numexpr#1\relax} + +% let\quantified\quantitied + %D \macros %D {dividedsize} %D -- cgit v1.2.3