[racket-dev] racket/date, SRFI-19, date construction

From: Asumu Takikawa (asumu at ccs.neu.edu)
Date: Fri Jan 11 23:57:27 EST 2013

On 2013-01-11 20:58:02 -0600, Robby Findler wrote:
>    I think backwards compatibility here is probably more important than it
>    producing a racket date. Is there some reason not to think so? I believe
>    this library gets used a lot.

Ok, attached is a second attempt that will use a different struct type
if `string->date` gets passed a format string that's missing day, month,
or year. The `make-date` function will also construct one of these lax
types if the day, month, or year fields is #t.  These dates should work
normally, except that racket/date won't like them.

This doesn't attempt to preserve other laxness in srfi/19. For example,
`make-date` previously would not do any error checking of its fields (so
it won't error until an operation is used which cares about that field).

It should also support deserialization like Ryan pointed out.

Cheers,
Asumu

Posted on the dev mailing list.