# [dev-context] numbers

Mon Jan 16 23:46:21 CET 2012

Am 16.01.2012 um 22:59 schrieb Hans Hagen:

> Hi Wolfgang,
>
> I redid some of strc-num so you'd better test it. One difference is that the 'user variants' do some checking due to the dodouble etc
>
> An alternative is to have different ones for normal and sub and do something like \def\xxx[#1]#2[#3]{...{#1}{#3}} i.e. hard tex errors
>
> A problem might be that users use \raw*counter which was expandable while now we have ...value alternatives for that (could be done consistently for more commands. Ok, we could keep old ones and use *value for checked ones instead. It all boils down to how compatible we want to be.
>
> So ... just an ftp beta and no public one yet.

There are a few names wrong, e.g.

\def\strc_counters_raw_interfaced
{\ifsecondargument
\singleexpandafter\strc_counters_raw_sub
\else\iffirstargument
\doubleexpandafter\strc_counters_raw_yes
\else
\doubleexpandafter\gobbletwooptionals
\fi\fi}

call \strc_counters_raw_sub or \strc_counters_raw_yes but then the yes form calls the hop form (now with braces)

\def\strc_counters_raw_yes  [#1][#2]{\strc_counters_raw_sub  {#1}\plusone}

and the hop form is defined twice

\def\strc_counters_raw_sub  [#1][#2]{\strc_counters_raw  {#1}{#2}}
\def\strc_counters_raw_sub  #1#2{\ctxcommand{structurecountervalue("\strc_counters_the{#1}",\number#2)}}

Another mistake is that the \*structurecountervalue expects two arguments, to fix this the following

\let\rawstructurecountervalue     \strc_counters_raw_yes
\let\laststructurecountervalue    \strc_counters_last_yes
\let\firststructurecountervalue   \strc_counters_first_yes
\let\nextstructurecountervalue    \strc_counters_next_yes
\let\prevstructurecountervalue    \strc_counters_prev_yes

should be changed to this

\def\rawstructurecountervalue  [#1]{\strc_counters_raw_yes  [#1][]}
\def\laststructurecountervalue [#1]{\strc_counters_last_yes [#1][]}
\def\firststructurecountervalue[#1]{\strc_counters_first_yes[#1][]}
\def\nextstructurecountervalue [#1]{\strc_counters_next_yes [#1][]}
\def\prevstructurecountervalue [#1]{\strc_counters_prev_yes [#1][]}

Wolfgang