unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: Nala Ginrut <nalaginrut@gmail.com>
Cc: Adam Faiz <adam.faiz@disroot.org>,
	 "guile-devel@gnu.org" <guile-devel@gnu.org>,
	 Ricardo Wurmus <rekado@elephly.net>
Subject: RE: [PATCH v2] rdelim: Add new procedure `for-line-in-file`.
Date: Mon, 16 Dec 2024 13:00:13 +0100	[thread overview]
Message-ID: <20241216130013.pQ0C2D00P1dDhme01Q0C65@xavier.telenet-ops.be> (raw)
In-Reply-To: <CAPjoZodKS+8W2qhjRyiQcSYqGAVuwSDSWVEQLpsmrmS5v=TV1A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3554 bytes --]

>I'm not going to pursued anyone here, just sharing my opinion about a patch for line parsing in a text file.😄
Then maybe you should stop it with the faces (“😄”) and strawmen. The faces just make things worse.
>Yes, some of the parsers don need backwards, but it also doesn't mean others parsers have priority to occupy a general API. 
Nowhere did I propose 'letting other parsers have priority to occupy a general API’. There is no priorisation here, only an option for choice. Maybe you could even let ‘read-line’ be the default (with optional arguments) (depending on where you put the procedure, if it’s in (ice-9 ports) there would probably be some inconvenient dependency issue – I don’t expect this side-remark would work out well).
>To my experience, a parser author like me prefer to write own parser from scratch for many reasons, rather than finding ans adapting to a general function buried deep under document.
The specific function is buried deep – it’s undocumented, you have to read the implementation of (ice-9 rdelim) or things like that to discover the existence.
Nowhere did I propose burying the general function. In fact, I proposed a location on where to place it, that isn’t at all ‘deep’, and surely better than the somewhat obscure (ice-9 rdelim). At the very least, it’s better than being undocumented.
Nowhere did I propose removing the special case. The special case could still be defined in (ice-9 rdelim), but this time implemented in terms of the general function.
Also, the general function is as much as parser as the specific function – it just repeats a single parser (read-line in specific case, the passed procedure in the general case) over the whole port.
>Here's my opinion, as a parser writer, I have no interest to use it, but I can say it still looks beautiful from functional programming perspective. Beauty is still a value worth to go. I can agree with this. But I don't use this function.
>Of course I speak only for myself as a potential existing user.
Nowhere did I say it has to be done because of beauty. The argument was on usefulness, and (implicitly) on how straightforward it is to generalise it (making it more useful, can be used by more people, avoids having to implement other variants since the general version already does it).
As a parser writer, I have little interest in using the ‘read-line’ specific variant. Most of the parsing I do is not based on lines.
>So if we can be back to the original topic, a patch for parsing text line function that can be understand and reviewex easy by most people. I believe the author's effort and my suggestions are well enough to go. 😄
There is nothing to go back to. The original patch did not parse lines(*), it only read them and left the actual parsing to ‘proc’/’body’. Also, iterating over lines in a file is a special case of iterating over more general things and the method of doing the generalisation is trivial, so this is entirely on topic. It’s the same topic, just broader. Also, the general version can also be understood and easily reviewed by most people, and I haven’t seen evidence to the contrary.
I think they _aren’t_ well enough to go, since I haven’t heard a good argument yet for _not_ generalising it.
(*) I.e., while it technically does parse something (extract line from text), it doesn’t parse the line itself (which in many cases will need to happen), and ‘recognising a line as a line’ is kind of trivial.
Best regards,
Maxime Devos


[-- Attachment #2: Type: text/html, Size: 5602 bytes --]

  reply	other threads:[~2024-12-16 12:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-16  6:14 [PATCH v2] rdelim: Add new procedure `for-line-in-file` Adam Faiz
2024-12-16  7:41 ` Nala Ginrut
2024-12-16 10:17 ` Maxime Devos
2024-12-16 10:29   ` Nala Ginrut
2024-12-16 10:52     ` Maxime Devos
2024-12-16 11:06       ` Nala Ginrut
2024-12-16 12:00         ` Maxime Devos [this message]
2024-12-16 12:33           ` Nala Ginrut

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=20241216130013.pQ0C2D00P1dDhme01Q0C65@xavier.telenet-ops.be \
    --to=maximedevos@telenet.be \
    --cc=adam.faiz@disroot.org \
    --cc=guile-devel@gnu.org \
    --cc=nalaginrut@gmail.com \
    --cc=rekado@elephly.net \
    /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).