Do others think this as well? To me, the shorter names which Adam selected
seem more palatable. Otherwise they get a bit long.
Den tis 17 dec. 2024 06:11Nala Ginrut skrev:
> The preferred activity in your design is more like for-each family, say,
> handle the result inside the proc without retur
The preferred activity in your design is more like for-each family, say,
handle the result inside the proc without return result. So maybe it should
be named as for-each-*-in-file, which is more understandable in the first
glance.
Best regards.
On Tue, Dec 17, 2024, 13:31 Adam Faiz wrote:
> From
>From 258d20a9665e6f845a167258c33374a00e734885 Mon Sep 17 00:00:00 2001
From: AwesomeAdam54321
Date: Tue, 17 Dec 2024 12:20:52 +0800
Subject: [PATCH] test-suite: Add tests for `for-rdelim-in-port`-related
functions.
* test-suite/tests/ports.test: Add test cases for
`for-delimited-in-port` and `f
Thanks for the work!
I didn’t find anything to be picky about yet in the implementation.
Now there are two things could go further.
1. About the port closing, I don’t insist on my previous suggestion right
now. There may be arguments against it by folks. I’m fine with any.
2. To complete a promis
>From b271d059615571d0d50027758494b8dbb5e8625e Mon Sep 17 00:00:00 2001
From: AwesomeAdam54321
Date: Mon, 16 Dec 2024 22:55:41 +0800
Subject: [PATCH 2/2] doc: Add documentation for `for-rdelim-in-port` and
related procedures.
* doc/ref/api-io.texi (for-rdelim-in-port): Document API.
(for-delimit
>From 302159fe61d9df526911ead8ea6ad823ad8b0443 Mon Sep 17 00:00:00 2001
From: AwesomeAdam54321
Date: Sun, 15 Dec 2024 23:48:30 +0800
Subject: [PATCH 1/2] rdelim: Add new procedure `for-rdelim-in-port`.
* module/ice-9/rdelim.scm (for-rdelim-in-port): Add it.
(for-delimited-in-port): Define as a sp
>
> I know you were told that it should close the port, but I am not sure
> about it. It should close the port it opened, but should it also the
> one it got? This will prevent the same port being processed multiple
> times, which could be annoying.
>
I'm sorry folks, I regretted to give this su
The faces icons are my speaking freedom as part of text. I grown up in a
dictatorship place, they don’t even let me stop typing faces 😁 and no one
told me smile faces make things worse. It is interesting to hear it first
time in my life.
“Well enough to go” means there is enough efforts to show an
>I think the port would leak if PROC were to raise an exception.
To my knowledge, this is currently kind of impossible to properly handle, since
Scheme doesn’t have ‘finally’. Closest thing is ‘dynamic-wind’ + close it in
the ‘out-guard’, but that isn’t quite right since (re)winding can happen
>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
>parser
Adam Faiz writes:
> +(define* (for-line-in-file file proc
> + #:key (encoding #f) (guess-encoding #f))
> + "Call PROC for every line in FILE until the eof-object is reached.
> +FILE can either be a filename string or an already opened input port.
> +The corresponding po
Adam Faiz writes:
> From fe113e9efc08aae2a7e3792a1018c496212bd774 Mon Sep 17 00:00:00 2001
> From: AwesomeAdam54321
> Date: Sun, 15 Dec 2024 23:48:30 +0800
> Subject: [PATCH v3] rdelim: Add new procedure `for-line-in-file`.
>
> * module/ice-9/rdelim.scm (for-line-in-file): Add it.
>
> This proce
I'm not going to pursued anyone here, just sharing my opinion about a patch
for line parsing in a text file.😄
Yes, some of the parsers don need backwards, but it also doesn't mean
others parsers have priority to occupy a general API.
To my experience, a parser author like me prefer to write own p
>You raised this topic from string line reading to more general case. 😄
Yes.
>If so, the best way could be providing a general function to wrap rdelim for
>for-each-seg-delim, users may pass a delimiter to decide how to delim (even
>for bytevectors), and implement for-line-a-file base on it with
You raised this topic from string line reading to more general case. 😄
If so, the best way could be providing a general function to wrap rdelim
for for-each-seg-delim, users may pass a delimiter to decide how to delim
(even for bytevectors), and implement for-line-a-file base on it with
unicode en
This is overly specific to reading lines, and reading lines with rdelim. If you
replace ‘read-line’ by an argument, the procedure becomes more general. For
example, by passing ‘get-char’ you can act on each character, with ‘get-line’
I’m not sure what the difference would be, but apparently it’
>From fe113e9efc08aae2a7e3792a1018c496212bd774 Mon Sep 17 00:00:00 2001
From: AwesomeAdam54321
Date: Sun, 15 Dec 2024 23:48:30 +0800
Subject: [PATCH v3] rdelim: Add new procedure `for-line-in-file`.
* module/ice-9/rdelim.scm (for-line-in-file): Add it.
This procedure makes it convenient to do pe
17 matches
Mail list logo