[plt-dev] SRFI 19 - parsing years from human input

From: Dave Gurnell (d.j.gurnell at gmail.com)
Date: Wed Mar 10 10:55:53 EST 2010

Here's a first attempt at this.

I've added a "~?" wildcard, so named because:

- all letters with the exception of ~g, ~o, and ~q are already used in date->string;
- ~g, ~o and ~q seemed inappropriate (although adding my own initial to the library was momentarily attractive);
- ~? implies an appropriate uncertainty about the number of digits in the year.

Not sure whether I've edited the right file for the documentation... presumably the SRFI pages are standard across all implementations. Could use some feedback on that.

I've also realised that none of the ~y, ~Y or ~? wildcards will recognise negative years. Not sure if this is a bug - I can correct this too if need be.

I've attached the following files in a ZIP archive:

complete source of $PLTHOME/collects/srfi/19/time.ss
complete source of $PLTHOME/collects/tests/srfi/19/tests.ss
complete source of $PLTHOME/doc/srfi-std/srfi-19.html
output from "svn diff"

Comments and corrections welcome.

Cheers,

-- Dave



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20100310/1716a353/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: srfi19-wildcard.zip
Type: application/zip
Size: 28195 bytes
Desc: not available
URL: <http://lists.racket-lang.org/dev/archive/attachments/20100310/1716a353/attachment.zip>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20100310/1716a353/attachment-0001.html>

Posted on the dev mailing list.