[plt-scheme] Re: Bug in PLT Scheme 204's SRFI 19 implementation?

From: Francisco Solsona (solsona at acm.org)
Date: Tue Aug 12 17:39:26 EDT 2003

Dirk Gerrits <dirk at gerrits.homeip.net> writes:

>> strings. But if I change those symbols into capitalized strings,
>> string->date works but date->string breaks. So the problem must lay
>> deeper, but I don't yet understand the code well enough.

Indeed, the problem lies a little bit deeper. :-(  The current
implementation of SRFI-19 included with PLT uses the ported SRFI-29
(localization) (that's why there are symbols instead of the expected
strings), see SRFI-29/localization.ss, and the srfi-19 bundle there.

Anyway, I just found, and corrected two bugs I missed before.  There
is a new exp-tagged version of time.ss, and the problem you were
seeing should go:

Welcome to MzScheme version 205, Copyright (c) 1995-2003 PLT
> (require (lib "19.ss" "srfi"))
> (define date-format "~a ~b ~d ~H:~M:~S ~Y")
> (define now (date->string (current-date) date-format))
> now
"Tue Aug 12 16:25:00 2003"
> (define d (string->date now date-format))
> (date->string d date-format)
"Tue Aug 12 16:25:00 2003"

Please give a try,

P.S. Neil W. Van Dyke has a non-localized port of SRFI-19 for PLT
Scheme, which has a smaller foot print.  IIRC, he was going to work it
a little bit more, before we could adopt it.

Posted on the users mailing list.