Ludovic Courtès <l...@gnu.org> writes: > Hi, > > Tomas Volf <~@wolfsden.cz> skribis: > >> The ~V is supposed to print ISO week number, not a week number. This >> commit fixes that. >> >> * module/srfi/srfi-19.scm (date-week-number-iso): New procedure taken >> from the reference implementation. >> (directives)<#\V>: Use it. >> * test-suite/tests/srfi-19.test ("date->string ~V"): Add tests taken >> from the reference test suite. > > The manual just reads this: > > ~U week of year, Sunday first day of week, ‘00’ to > ‘52’ > ~V week of year, Monday first day of week, ‘01’ to > ‘53’ > > Should it be fixed or clarified?
Definitely, updated to reference the ISO-8601. > >> +(define (date-week-number-iso date) > > Please add a docstring. Done. > >> + (let ((convert (λ (lst) >> + (date->string >> + (make-date 0 0 0 0 >> + (caddr lst) (cadr lst) (car lst) > > Please use ‘match-lambda’. Yeah that is much nicer. > >> + (with-test-prefix "date->string ~V" >> + (pass-if-equal "Thursday, week 53" "53" > > If these are from the SRFI-19 spec, could you add a comment to say so? Good point, done. > > Thanks, > Ludo’. -- There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.
signature.asc
Description: PGP signature