From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Guu, Jin-Cheng" Newsgroups: gmane.emacs.devel Subject: Re: Shorter and more flexible implementation for parse-time.el Date: Sun, 25 Jul 2021 04:38:06 -0500 Message-ID: References: <87mtqb3o7q.fsf@gnus.org> <87lf5uzyt0.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19821"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jul 25 11:38:56 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m7ab1-00053q-GT for ged-emacs-devel@m.gmane-mx.org; Sun, 25 Jul 2021 11:38:55 +0200 Original-Received: from localhost ([::1]:55390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m7ab0-0007HG-IH for ged-emacs-devel@m.gmane-mx.org; Sun, 25 Jul 2021 05:38:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m7aaU-0006YB-5D for emacs-devel@gnu.org; Sun, 25 Jul 2021 05:38:22 -0400 Original-Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]:36506) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m7aaS-0003SB-Hf for emacs-devel@gnu.org; Sun, 25 Jul 2021 05:38:21 -0400 Original-Received: by mail-ej1-x630.google.com with SMTP id gn26so4552080ejc.3 for ; Sun, 25 Jul 2021 02:38:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1nqiJHDvB1WU8pDVMNv1d+1P3GjumsyM252LhaE9UCE=; b=HfOifloYefc1VIkVlmPjM2eWS+csdjXZe/pOP9VwrJJUHLF2PblsFguBpV4n9Bglqy JRHRYN9jUTH5v2aiDdqgdetRAm9xetInXvf/uA3HxRQE10nAr8/QDkXgByPzq/71DE4g jfuw7KlD1re7pC6vCYvYhvA0r9x91Z15/+TvLSTBb87aRFxXvlAszRLdqZJsaHAu3QPO ouhpnBriYBbB0cfyeZUngP8gxY4RDPbN5c1iJ/scTpBbVgU5wiu3ddycyhRLqAyXsJvK 3OaAGk5EY8PbfEAtjmQ+ZNJKy8xfbCjt5F9GbOWWI25nRywzPECb11xBlkBt9cRs1whF v8Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1nqiJHDvB1WU8pDVMNv1d+1P3GjumsyM252LhaE9UCE=; b=hJWkG96XumXOrs4EC36r5EzFnDywBSQ4BtSvfggir1YQJTxjsx5CvTtYZdaWC1i38Q W/wZUukaFplr0ooQKKoTjDxja7C2xoJOHflSaLKUFgOY1uAB4QZ5n8G3jmD464scAmpS zZVEUaYB4ITlBkVyk5ZzPe1RDvhMrodwQ/yEFpkoAWmGPLLriZDZpFxnzCvtEXRgDD51 zgt3L/LmUQCayOXPxfWwcotfLC1DC60X7k6Z1I4oK2ctDVPT3y9bx4vvlzKOgaiirald IBxT3EUpTf4w0tLJOBHnWD+c+3EN4OTGuVZKABmOA9xQGuFTeYWmhlSkhMow5fTlUeq9 +Zhg== X-Gm-Message-State: AOAM5328vckz0CcKefhVVt2F57pAketOoZ0IdCWddE9cEBFefSjlp3xL /8hvQA4IzhCgtmrzfCqVjd3uHJgQCp6DATGq7w0= X-Google-Smtp-Source: ABdhPJxI3+2G26ck6WJC6LrUsc95QgoLX5bP/zYkfSO0qNsPQ/WM0ptYJCHu/ySIgoh1VMMVhdqWuywEurWkmOhSnQM= X-Received: by 2002:a05:6402:312e:: with SMTP id dd14mr15334810edb.33.1627205897945; Sun, 25 Jul 2021 02:38:17 -0700 (PDT) In-Reply-To: <87lf5uzyt0.fsf@gnus.org> Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=jcguu95@gmail.com; helo=mail-ej1-x630.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:271593 Archived-At: Thanks for sharing your food for thought! If a project wants to use a fixed format with fixed length for each entry, I believe that short function is useful. I do not know if this is often wanted by others, but for me I constantly run into this question. If there's no need, I won't push too. Just want to offer some help :) So yeah, my library won't deal with "3-NOV-94", but it can deal with "03-NOV-94" or even "003-NOV-94" if the user decides to fix the format to be "dd-mmm-YY" or "0dd-mmm-YY". And you're totally right, date parsing as a whole won't be easy. In general we would hope for a parser that is smart enough to deal with flexible formats. However, some specification needs to be given at some point - for example "01/01/01". That is why I came up with an assumption that I think is general enough but also can have a definite output. Cheers, Jin