ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* date handling maltreated?
@ 2013-03-20 15:40 H. van der Meer
  2013-03-20 15:45 ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: H. van der Meer @ 2013-03-20 15:40 UTC (permalink / raw)
  To: ConTeXt NTG


[-- Attachment #1.1: Type: text/plain, Size: 2101 bytes --]

Trying to do some date and time processing myself, I ran into problems caused by ConTeXt makeing it incompatibel with the original plain TeX itself!

In the TeX-book, Appendix B one finds
<citation>
(Some parameters are set by TeX itself as it runs, so it is inappropriate to initialize them: \time, \day, \month, and year are established at the beginning of a job; ..
</citation>

Now the results in ConTeXT with a minimal example, put into the log for easier copying into the mail:
\starttext
\writestatus{}{\meaning\date -> \date}
\writestatus{}{\meaning\day -> \the\day}
\writestatus{}{\meaning\month -> \month WHY NOT monthname?}
\writestatus{}{\meaning\year -> \the\year}
\writestatus{}{\meaning\time -> \the\time}
\stoptext

Result:
> \protected macro:->\dodoubleempty \syst_converters_date -> \date 
> \day-> 20
> macro:#1->\ctxcommand {monthname(#1)}-> \labeltext {unknown}HY NOT monthname?
> \year-> 2013
> \time-> 989

Plain TeX here gives:
\message{\meaning\day -> \the\day}
\message{\meaning\month -> \the\month}
\message{\meaning\year -> \the\year}
\message{\meaning\time -> \the\time}
\end

Result:
(./plaindates.tex \day-> 20 \month-> 3 \year-> 2013 \time-> 991 )

I strongly ask that ConTeXt abstains from changing the definition of \month and reverts to the exact result as given by plain TeX, i.e. a number in the range [1-12]. Because the change in ConTeXt makes it impossible to do calculations on the month.

Furthermore I encountered problems with defining expanded macros for currentdate and currenttime. This seems impossible to accomplish, at least in a simple manner. See the results from these to examples:
\edef\thedate{\currentdate}\writestatus{}{\meaning\thedate -> \thedate}
\edef\thetime{\currenttime}\writestatus{}{\meaning\thetime -> \thetime}
giving:
> macro:->\currentdate -> \currentdate 
> macro:->\currenttime -> \currenttime 

This is most unhappy, because one really should be able to put the expansions of these macros somewhere.
I hope the next beta will have solutions for these problems.

Hans van der Meer


[-- Attachment #1.2: Type: text/html, Size: 4897 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: date handling maltreated?
  2013-03-20 15:40 date handling maltreated? H. van der Meer
@ 2013-03-20 15:45 ` Wolfgang Schuster
  2013-03-20 16:26   ` Meer H. van der
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Schuster @ 2013-03-20 15:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2302 bytes --]


Am 20.03.2013 um 16:40 schrieb H. van der Meer <H.vanderMeer@uva.nl>:

> Trying to do some date and time processing myself, I ran into problems caused by ConTeXt makeing it incompatibel with the original plain TeX itself!
> 
> In the TeX-book, Appendix B one finds
> <citation>
> (Some parameters are set by TeX itself as it runs, so it is inappropriate to initialize them: \time, \day, \month, and year are established at the beginning of a job; ..
> </citation>
> 
> Now the results in ConTeXT with a minimal example, put into the log for easier copying into the mail:
> \starttext
> \writestatus{}{\meaning\date -> \date}
> \writestatus{}{\meaning\day -> \the\day}
> \writestatus{}{\meaning\month -> \month WHY NOT monthname?}
> \writestatus{}{\meaning\year -> \the\year}
> \writestatus{}{\meaning\time -> \the\time}
> \stoptext
> 
> Result:
> > \protected macro:->\dodoubleempty \syst_converters_date -> \date 
> > \day-> 20
> > macro:#1->\ctxcommand {monthname(#1)}-> \labeltext {unknown}HY NOT monthname?
> > \year-> 2013
> > \time-> 989
> 
> Plain TeX here gives:
> \message{\meaning\day -> \the\day}
> \message{\meaning\month -> \the\month}
> \message{\meaning\year -> \the\year}
> \message{\meaning\time -> \the\time}
> \end
> 
> Result:
> (./plaindates.tex \day-> 20 \month-> 3 \year-> 2013 \time-> 991 )
> 
> I strongly ask that ConTeXt abstains from changing the definition of \month and reverts to the exact result as given by plain TeX, i.e. a number in the range [1-12]. Because the change in ConTeXt makes it impossible to do calculations on the month.
> 
> Furthermore I encountered problems with defining expanded macros for currentdate and currenttime. This seems impossible to accomplish, at least in a simple manner. See the results from these to examples:
> \edef\thedate{\currentdate}\writestatus{}{\meaning\thedate -> \thedate}
> \edef\thetime{\currenttime}\writestatus{}{\meaning\thetime -> \thetime}
> giving:
> > macro:->\currentdate -> \currentdate 
> > macro:->\currenttime -> \currenttime 
> 
> This is most unhappy, because one really should be able to put the expansions of these macros somewhere.
> I hope the next beta will have solutions for these problems.

TeX primitives are available under \normal…

Wolfgang


[-- Attachment #1.2: Type: text/html, Size: 5326 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: date handling maltreated?
  2013-03-20 15:45 ` Wolfgang Schuster
@ 2013-03-20 16:26   ` Meer H. van der
  0 siblings, 0 replies; 6+ messages in thread
From: Meer H. van der @ 2013-03-20 16:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 3013 bytes --]

On 20 mrt. 2013, at 16:45, Wolfgang Schuster <schuster.wolfgang@gmail.com>
 wrote:

> 
> Am 20.03.2013 um 16:40 schrieb H. van der Meer <H.vanderMeer@uva.nl>:
> 
>> Trying to do some date and time processing myself, I ran into problems caused by ConTeXt makeing it incompatibel with the original plain TeX itself!
>> 
>> In the TeX-book, Appendix B one finds
>> <citation>
>> (Some parameters are set by TeX itself as it runs, so it is inappropriate to initialize them: \time, \day, \month, and year are established at the beginning of a job; ..
>> </citation>
>> 
>> Now the results in ConTeXT with a minimal example, put into the log for easier copying into the mail:
>> \starttext
>> \writestatus{}{\meaning\date -> \date}
>> \writestatus{}{\meaning\day -> \the\day}
>> \writestatus{}{\meaning\month -> \month WHY NOT monthname?}
>> \writestatus{}{\meaning\year -> \the\year}
>> \writestatus{}{\meaning\time -> \the\time}
>> \stoptext
>> 
>> Result:
>> > \protected macro:->\dodoubleempty \syst_converters_date -> \date 
>> > \day-> 20
>> > macro:#1->\ctxcommand {monthname(#1)}-> \labeltext {unknown}HY NOT monthname?
>> > \year-> 2013
>> > \time-> 989
>> 
>> Plain TeX here gives:
>> \message{\meaning\day -> \the\day}
>> \message{\meaning\month -> \the\month}
>> \message{\meaning\year -> \the\year}
>> \message{\meaning\time -> \the\time}
>> \end
>> 
>> Result:
>> (./plaindates.tex \day-> 20 \month-> 3 \year-> 2013 \time-> 991 )
>> 
>> I strongly ask that ConTeXt abstains from changing the definition of \month and reverts to the exact result as given by plain TeX, i.e. a number in the range [1-12]. Because the change in ConTeXt makes it impossible to do calculations on the month.
>> 
>> Furthermore I encountered problems with defining expanded macros for currentdate and currenttime. This seems impossible to accomplish, at least in a simple manner. See the results from these to examples:
>> \edef\thedate{\currentdate}\writestatus{}{\meaning\thedate -> \thedate}
>> \edef\thetime{\currenttime}\writestatus{}{\meaning\thetime -> \thetime}
>> giving:
>> > macro:->\currentdate -> \currentdate 
>> > macro:->\currenttime -> \currenttime 
>> 
>> This is most unhappy, because one really should be able to put the expansions of these macros somewhere.
>> I hope the next beta will have solutions for these problems.
> 
> TeX primitives are available under \normal…
> 
> Wolfgang
> 

That is most unfortunate. Why not keep compatibility with plain TeX where possible? I see that \time, \day and \year have been left untouched. So why messing up \month? Sorry for the expression, no offense meant, but in my eyes this is unnecessary tinkering with established macros.
What speaks against keeping \month as is? And doing the translation through \monthname? It looks to me even more transparent and it could use the \language for translation.
No, this shouldn't have happened and I strongly urge that the original meaning returns to ConTeXt.



[-- Attachment #1.2: Type: text/html, Size: 6302 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: date handling maltreated?
  2013-03-20 15:26 H. van der Meer
  2013-03-20 15:27 ` Meer H. van der
@ 2013-03-20 20:34 ` Hans Hagen
  1 sibling, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2013-03-20 20:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 3/20/2013 4:26 PM, H. van der Meer wrote:

> I strongly ask that ConTeXt abstains from changing the definition of \month and reverts to the exact result as given by plain TeX, i.e. a number in the range [1-12]. Because the change makes it impossible to do calculations on the month.

well, it has been the case for ages ... other commands also have a 
different meaning, like \language, and \unexpanded is actually in tex 
speak \protected (but we had an \unexpanded long before that one showed 
up) and \\expanded is a macro in context and a primitive in tex ... etc

as Wolfgang pointed out: use \normaldate

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: date handling maltreated?
  2013-03-20 15:26 H. van der Meer
@ 2013-03-20 15:27 ` Meer H. van der
  2013-03-20 20:34 ` Hans Hagen
  1 sibling, 0 replies; 6+ messages in thread
From: Meer H. van der @ 2013-03-20 15:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 376 bytes --]

Sorry, not yes finished, accidently sent away too soon.

Hans van der Meer



On 20 mrt. 2013, at 16:26, "H. van der Meer" <H.vanderMeer@uva.nl>
 wrote:

> Trying to do some date and time processing myself, I ran into problems caused by ConTeXt makeing it incompatibel with the original plain TeX itself!
> 
> In the TeX-book, Appendix B one finds
> <citation>


[-- Attachment #1.2: Type: text/html, Size: 1975 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* date handling maltreated?
@ 2013-03-20 15:26 H. van der Meer
  2013-03-20 15:27 ` Meer H. van der
  2013-03-20 20:34 ` Hans Hagen
  0 siblings, 2 replies; 6+ messages in thread
From: H. van der Meer @ 2013-03-20 15:26 UTC (permalink / raw)
  To: ConTeXt NTG

Trying to do some date and time processing myself, I ran into problems caused by ConTeXt makeing it incompatibel with the original plain TeX itself!

In the TeX-book, Appendix B one finds
<citation>
(Some parameters are set by TeX itself as it runs, so it is inappropriate to initialize them: \time, \day, \month, and year are established at the beginning of a job; ..
</citation>

Now the results in ConTeXT with a minimal example, put into the log for easier copying into the mail:
\starttext
\writestatus{}{\meaning\date -> \date}
\writestatus{}{\meaning\day -> \the\day}
\writestatus{}{\meaning\month -> \month WHY NOT monthname?}
\writestatus{}{\meaning\year -> \the\year}
\writestatus{}{\meaning\time -> \the\time}
\stoptext

Result:
                > \time-> \time 
                > \protected macro:->\dodoubleempty \syst_converters_date -> \date 
                > \day-> 20
                > macro:#1->\ctxcommand {monthname(#1)}-> \labeltext {unknown}RROR
                > \year-> 2013
                > \time-> 982

I strongly ask that ConTeXt abstains from changing the definition of \month and reverts to the exact result as given by plain TeX, i.e. a number in the range [1-12]. Because the change makes it impossible to do calculations on the month.

Hans van der Meer



___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-03-20 20:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-20 15:40 date handling maltreated? H. van der Meer
2013-03-20 15:45 ` Wolfgang Schuster
2013-03-20 16:26   ` Meer H. van der
  -- strict thread matches above, loose matches on Subject: below --
2013-03-20 15:26 H. van der Meer
2013-03-20 15:27 ` Meer H. van der
2013-03-20 20:34 ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).