From: Lars Ingebrigtsen <larsi@gnus.org>
To: "Guu, Jin-Cheng" <jcguu95@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Shorter and more flexible implementation for parse-time.el
Date: Sun, 25 Jul 2021 08:34:51 +0200 [thread overview]
Message-ID: <87lf5uzyt0.fsf@gnus.org> (raw)
In-Reply-To: <CAErjG5cNa-7T+HUYDwnFOM=7WnEpb7z3ZBw9QFxYSTwG0TRSZQ@mail.gmail.com> (Jin-Cheng Guu's message of "Sat, 24 Jul 2021 10:03:40 -0500")
"Guu, Jin-Cheng" <jcguu95@gmail.com> writes:
> Thanks for your response! I've done some research, and the formats I
> have seen all have their rigid formats (with a fixed length in
> particular) [1][2][3]. Would you mind pointing me to some exceptions?
> I can try to accommodate.
There's a million formats out there, like "3-NOV-94" etc in various
permutations.
> That said, I'd argue it is still useful. It is much shorter, is
> flexible and customizable, and uses lisp sexprs instead of a
> DSL. Please feel free to let me know what it lacks of, I will try to
> work on it and present a final result. =)
My experience is that there is no DSL that can cover date parsing that's
handier than just writing some code, unfortunately. Your library covers
the
(encode-time
(mapcar (lambda (bit)
(if bit
(string-to-number bit)
0))
(list nil nil nil (substring string 0 2)
(substring string 2 4)
(substring string 4 8))))
etc case, and that's not where the hard thing in date parsing is.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
next prev parent reply other threads:[~2021-07-25 6:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-23 17:03 Shorter and more flexible implementation for parse-time.el Guu, Jin-Cheng
2021-07-24 12:12 ` Lars Ingebrigtsen
2021-07-24 15:03 ` Guu, Jin-Cheng
2021-07-25 6:34 ` Lars Ingebrigtsen [this message]
2021-07-25 9:38 ` Guu, Jin-Cheng
2021-07-25 9:58 ` Yuri Khan
2021-07-25 10:14 ` Arthur Miller
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/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lf5uzyt0.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=emacs-devel@gnu.org \
--cc=jcguu95@gmail.com \
/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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).