#Guix comrades, I’ve fixed a longstanding limitation of self-referential records by introducing a new linguistic device (fancy!) to refer to the inherited value of a field!
https://codeberg.org/guix/guix/pulls/6955
Let records refer to inherited field values

This fixes [a longstanding limitation](https://issues.guix.gnu.org/50335) of self-referential records (meaning using self references like `this-package`) that would show when using the typical package inheritance patterns.

Codeberg.org

It brings much joy to me but it’s kinda frustrating that the situation being addressed is so hard to explain.

(And at the same time probably trivial to programming language folks who’ve dealt with recursive records/attribute sets and the likes.)

@civodul i love it! c:

it's been many years now since i've kept my guix checkout up-to-date, but i'd written a macro, `modify-record`, using cut-inspired syntax to similar effect

(eg. in https://codeberg.org/antlers/old-guix-config/src/branch/main/modules/antlers/systems/transformations/yubi.scm)

i used literals `=>`, `-->`, or `->` at the call-site to branch over whether a field was thunked, delayed, or neither (resp.). wasn't able to wrap my mind around the records internals enough to make that implicit before moving on to my next fixation

i infer from the terminology in the issue and scope of the changes that this *only* applies to thunked fields (generally build-system `arguments` and os `services`), and not to un-thunked fields (like os `users` or os `kernel-arguments`), nor to `delay`-ed fields (took a second to find one: os `swap-devices`) if still applicable 3 years since

no notes tbh, just want to be sure you know someone's already seen this who knows exactly what you mean and appreciates you -- there are dozens (of dozens!) of us c:

old-guix-config/modules/antlers/systems/transformations/yubi.scm at main

old-guix-config - Uploaded for posterity, sans commit history and some sensative files.

Codeberg.org

@antlers Thanks for the reply, it’s good to not feel too lonely. :-)

Your ‘modify-record’ macro looks nice BTW, good to know you also looked into this!