[racket] SRFI 19 string->date: Error reading dates
Looks like a bug to me. The error is happening inside srfi-lite-lib, and as far as I can tell, it’s due to a rather strange line of code on line 1488 of srfi/19/time.rkt:
(do-nothing (lambda (val object) (values)))
This function returns zero values, causing the arity error. As far as I can tell, it should be this instead:
(do-nothing (lambda (val object) object))
That is, it should simply return the object parameter it receives. That seems to fix the problem for me, but I’m quite unfamiliar with this code, so I can’t be sure.
> On Jan 31, 2015, at 20:31, Jordan Johnson <jmj at fellowhuman.com> wrote:
>
> Hi all,
>
> I’m running into this problem with string->date in srfi/19:
>
> ;;; begin Interactions
> > (require srfi/19)
> > (string->date "Sun, 02 Feb 2015" "~a, ~d ~b ~Y”)
> result arity mismatch;
> expected number of values not received
> expected: 1
> received: 0
> values...:
> ;;; end Interactions
>
> I’m assuming there’s something I am missing about how dates are handled, but from what I’ve read it seems like the code above should be doing it. What am I missing?
>
> (And, is there a better way to be reading dates in Racket, or is this the preferred way?)
>
> Best,
> jmj
>
> P.S. Attempting to copy/paste the above error message from the Interactions window crashed DrR (v6.1.1) three times. This doesn’t seem to be reproducible by copying any other error messages, though, so I haven’t filed a bug report yet; figured perhaps the answer to the string->date problem may shed some light on this, too...
>
>
> ____________________
> Racket Users list:
> http://lists.racket-lang.org/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20150131/ac0e6181/attachment-0001.html>