unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Zefram <zefram@fysh.org>
Cc: 21904@debbugs.gnu.org
Subject: bug#21904: date->string duff ISO 8601 format for non-4-digit years
Date: Sat, 20 Oct 2018 23:53:24 -0400	[thread overview]
Message-ID: <87efck0xcb.fsf@netris.org> (raw)
In-Reply-To: <87woqc16kd.fsf@netris.org> (Mark H. Weaver's message of "Sat, 20 Oct 2018 20:34:10 -0400")

Mark H Weaver <mhw@netris.org> writes:
> Another question is whether or not we should raise an exception when
> attempting to print a year that cannot be represented in the requested
> year format.

I thought about it some more, and I'm now inclined to think that the
approach in your patches is reasonable, or at least it's the least bad
thing we can do when asked to print a year that doesn't fit within the
standard format, given the existing SRFI-19 API.

I also just noticed that the SRFI-19's reference implementation's
formatting of negative years is very badly broken (e.g. it prints "00-2"
when the year field is -2) and Guile had the same behavior after I
applied the fix from upstream to pad the year to 4 digits.

So, for now, I went ahead and implemented the behavior that you
recommended, with one difference: where you hardcode the padding
character to #\0 when formatting years, I use the padding character
specified by the user, following the SRFI-19 reference implementation.

What do you think?

      Mark





      reply	other threads:[~2018-10-21  3:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-13 14:22 bug#21904: date->string duff ISO 8601 format for non-4-digit years Zefram
2017-04-20  0:04 ` Zefram
2017-04-20  0:07   ` Zefram
2018-10-20 22:41 ` Mark H Weaver
2018-10-21  0:34 ` Mark H Weaver
2018-10-21  3:53   ` Mark H Weaver [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87efck0xcb.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=21904@debbugs.gnu.org \
    --cc=zefram@fysh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).