Re: [PATCH v3] rdelim: Add new procedure `for-line-in-file`.

2024-12-16 Thread Nala Ginrut
> > 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

RE: [PATCH v3] rdelim: Add new procedure `for-line-in-file`.

2024-12-16 Thread Maxime Devos
>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

Re: [PATCH v3] rdelim: Add new procedure `for-line-in-file`.

2024-12-16 Thread Ricardo Wurmus
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

Re: [PATCH v3] rdelim: Add new procedure `for-line-in-file`.

2024-12-16 Thread Tomas Volf
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)

[PATCH v3] rdelim: Add new procedure `for-line-in-file`.

2024-12-16 Thread Adam Faiz
>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