[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#34999: Record special field abstraction leakage
From: |
Leo Prikler |
Subject: |
bug#34999: Record special field abstraction leakage |
Date: |
Tue, 24 Aug 2021 17:47:30 +0200 |
User-agent: |
Evolution 3.34.2 |
Hi Ludo,
I think I have found out why users see the thunked fields as below.
Am Dienstag, den 26.03.2019, 10:38 +0100 schrieb Ludovic Courtès:
> The changes I made in version-control.scm and gnucash.scm in commit
> e6301fb76d0a8d931ece2e18d197e3c2cc53fc6c revealed an abstraction
> leakage
> I wasn’t aware of: there’s a pattern where users “see” that thunked
> fields are thunked:
>
> (package
> ;; …
> (inputs …)
> (arguments `(foo bar ,(inputs) …))) ;<- here ‘inputs’ is seen as
> a thunk
The issue is that for constructing the records, we let*-bind the field
names to their values before calling the constructor. In these let*-
bindings the fields are already wrapped, e.g. inputs will be bound to
the value that the record field inputs will have, not to the raw value.
I've attached a patch to fix this issue as well as a MWE to try it out.
I'm not sure about the broader semantics of this patch, though. I fear
that exposing raw values through let-binding probably eliminates the
delayed/thunked nature of said fields in some ways. WDYT?
0001-guix-records-let-bind-raw-values-wrap-them-in-constr.patch
Description: Text Data
34999-mwe.scm
Description: Text Data
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#34999: Record special field abstraction leakage,
Leo Prikler <=