I think you may wish to check this further.

>current-time: now/time

>file-name: rejoin [
  now/year
  now/month
  now/day
  current-time/hour
  current-time/minute
  current-time/second
  ]

>complete-file-name: rejoin [{%} file-name {.html}]

When I was looking at something similar, I hit a problem
because the integer returned is of course not 0-padded on the left.
So, is it (2000116) November 6th or is it January 16th??
Statistically it may be unlikely to cause a problem,
but if it could happen even once and that would mess you
up bad, then you better pre-pad the month and day with 0 when necessary.



<rant>



This is part of a general theme.

You can't strip out punctuation ( dates use  / - ) and not pad (0) instead --

not unless you have a pretty sophisticated encoding process,

which is rare enough.



It's similar with escape codes in strings and so forth.

We often want to have our cake and eat it too.



Unicode makes everything two bytes and that has the

advantage of simplicity.  But it bites in certain applications

where bandwidth or storage is precious.  Escape systems

potentially offer more flexibility, but they also introduce complexity.



C-strings suck, too.  Great, they can be of indefinite length.

But that also means you can't quickly get the length of the

string without scanning the whole thing.  And because there's

no escape-encoding of the 0-terminator, you can't use any

of those in a string.  And even though it's only 1 special

character that's restricted, it ruins so many applications.



And of course there isn't a c-programmer alive who

hasn't run right of the end of his string and corrupted

his memory.  It's a hell of a lot of fun, actually,

a bit like bungy-jumping.  Goodness gracious,

I hope there's a zero at the end of this thing!



I remember years ago trying to send a zero in part of

a printer-setup command sequence, and because dbase was

written in c, you couldn't send it to the printer at all.

Actually there was a work-around, but you had to write

and assemble little assembly language scripts and

load them in at run-time.  I'm sure others could come

up with loads of similar horror stories.



The day c disappears from the planet will be a happy one.

One day we'll look on it with feelings akin to the way

we feel today about COBOL.



</rant>



good luck



-galt



Reply via email to