Path: utzoo!attcan!uunet!bellcore!att!pacbell.com!decwrl!fernwood!portal!cup.portal.com!ts From: ts@cup.portal.com (Tim W Smith) Newsgroups: comp.lang.c Subject: Re: need "yy-ddd-hh:mm:ss ==> (time_t) clock" converter Message-ID: <39643@cup.portal.com> Date: 28 Feb 91 10:05:14 GMT References: <368@bria> <6586@gssc.UUCP><2323@stsci.EDU> <1991Feb18.133937.28469@fivegl.co.nz><790@saxony.pa.reuter.COM> Organization: The Portal System (TM) Lines: 41 < I can't believe this. At run-time, you do useful things, not table < generation. You can easily do it pre-compile-time, once. You write a < few shell commands to do that, or some simple-minded elisp code, and < include the code as a comment: [He then gives examples of including in comments in the source code suggested shell or elisp commands that the user can use to generate the table] Well, I can't believe this, either! What about simply doing this: #define JAN 0 #define FEB JAN+31 #define MAR FEB+28 #define APR MAR+31 #define MAY APR+30 #define JUN MAY+31 #define JUL JUN+30 #define AUG JUL+31 #define SEP AUG+31 #define OCT SEP+30 #define NOV OCT+31 #define DEC NOV+30 int days[] = { JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC }; When someone wishes to port this program to a different machine, they don't have to have the shell or emacs or other tools to generate the table. < Morale: Let the machines do the chores. But going out of our way to create these chores for the machines to do seems to me to be counterproductive! Tim Smith