need "yy-ddd-hh:mm:ss ==> (time_t) clock" converter
Tim W Smith
ts at cup.portal.com
Thu Feb 28 21:05:14 AEST 1991
< 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
More information about the Comp.lang.c
mailing list