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

From: Asumu Takikawa (asumu at ccs.neu.edu)
Date: Sat Jan 12 00:29:24 EST 2013

On 2013-01-11 23:08:30 -0600, Robby Findler wrote:
>    How about calling the new struct "lax-date" or something like that, using
>    the word you're using below -- I'm not tied to that word, but something
>    that explains more why it is there seems good.

That sounds good.

>    Also, I think the documentation needs to be updated to explain the
>    relationship between the racket/date structs and the srfi-19 date structs.
>    I'm less clear about the other laxness. One other possible thing to
>    consider is that srfi:make-date could do all the same checking that date*
>    does, but if any of it fails (perhaps catch the exn) it creates a lax
>    date. That seems safest.

I thought about this, and the only objection that I had was that a
contract error could now silently turn into a valid old srfi/19 style
date object. Then again, this would only happen with the constructor
exported from srfi/19, so maybe it's not a big deal.

In any case, see attached patch for implementation (just catches the
exception).

Cheers,
Asumu

Posted on the dev mailing list.