Gnus development mailing list
 help / color / mirror / Atom feed
From: Ken Raeburn <raeburn@cygnus.com>
Subject: Re: timezone.el patterns in emacs 19.34
Date: 03 May 1997 19:44:25 -0400	[thread overview]
Message-ID: <tx167x086jq.fsf@cygnus.com> (raw)
In-Reply-To: Hrvoje Niksic's message of 03 May 1997 06:04:52 +0200

Hrvoje Niksic <hniksic@srce.hr> writes:

> > Besides, I think you'd probably wind up doing the regexp bit
> > anyways, just at the C level.  These patterns don't have to match
> > the *entire* string, just some substring.
> I would do no regexp matching.  If I had to resort to regexps, then I
> would rather leave it in Lisp, as it is.

Okay, so how would you get around the requirement of matching a
substring, without using regexps?  If you can do it, and get much
better performance than we've got now with the lisp code, great.  But
as I just indicated in other mail, my trivial little patch already
addresses the performance issue to some degree.  So you'll have to do
even better. :-)

And, by the way, if you do go ahead with this, I'd suggest returning
numbers instead of strings when practical.  They can be turned into
strings easily enough in lisp, and the gnus-dd-mmm usage just converts
them back to numbers and discards the strings, which means more
needless garbage to collect.  (Don't underestimate the cost of garbage
collection.  I've managed to speed up some code by tweaking it to
allocate less short-term heap storage.)

> NO!  I hate getdate.y.  First, because of the `.y' thingie. :-)

Aside from the substring issue, I think a parser would be well suited
to this task.  I see two advantages to it:
 * Tokenizes first, then looks for patterns in the tokens; this means
   any backtracking doesn't have to re-process every character.
 * Yacc sets up a FSM for matching multiple sequences in parallel (as
   do the more sophisticated regexp matchers), so if a match is going
   to be made, it'll be made in one pass; the hairy work is done at
   build time.
Certainly, yacc isn't the be-all and end-all of parsing technology, by
a long shot.  But it's up to this task.

>	  Then,
> there are copyright problems with it.

No, there aren't.  The version I'm looking at has a "public domain, no
copyright" label on it.  There would be no problem with incorporating
a copy into emacs.

>	  And, I'd like to have a fast
> routine that matches those 7 or so format strings.

Yes, that's the problem I see with it -- it'll handle more than we
want.  A date header saying "+23hours" is bogus, and should be treated
as such.  Though if getdate.y matches more "real" date formats than
timezone-parse-date, I don't think it would be a bad idea to support
them as well, since this is timezone-parse-date we're talking about,
and not gnus-parse-conforming-date-header.

Ken


  reply	other threads:[~1997-05-03 23:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <199705020844.EAA06520@kr-laptop.cygnus.com>
1997-05-03  1:14 ` Hrvoje Niksic
1997-05-03  3:07   ` Ken Raeburn
1997-05-03  4:04     ` Hrvoje Niksic
1997-05-03 23:44       ` Ken Raeburn [this message]
1997-05-04  0:41         ` Hrvoje Niksic
1997-05-04  3:03           ` Ken Raeburn
1997-05-04 19:55             ` Hrvoje Niksic
1997-05-04 20:49               ` Johan Danielsson
1997-05-04 20:55                 ` Hrvoje Niksic
1997-05-04 22:22                   ` Public domain (was: timezone.el patterns in emacs 19.34) Johan Danielsson
1997-05-05  6:52                     ` Lars Magne Ingebrigtsen
1997-05-04 22:55                   ` timezone.el patterns in emacs 19.34 Stainless Steel Rat
1997-05-08 12:37         ` Lars Magne Ingebrigtsen
1997-05-03 22:41   ` Ken Raeburn
1997-05-02 23:18 Ken Raeburn

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

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

  git send-email \
    --in-reply-to=tx167x086jq.fsf@cygnus.com \
    --to=raeburn@cygnus.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.
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 NNTP newsgroup(s).