[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A new paradigm for modifying operating system declarations
From: |
Jan Wielkiewicz |
Subject: |
Re: A new paradigm for modifying operating system declarations |
Date: |
Tue, 5 Jan 2021 00:26:44 +0100 |
Dnia 2021-01-04, o godz. 15:38:38
raid5atemyhomework <raid5atemyhomework@protonmail.com> napisaĆ(a):
> Hi guix-developers,
Hello.
> ```scheme
> (install-zfs
> (operating-system
> (kernel linux-libre-5.4)
> ; ... other fields ...
> ))
> ```
I don't like this way of nesting the OS declaration inside of any other
expression.
>
> ```scheme
> (install-foo
> (install-bar
> (install-zfs
> (operating-system
> #;...))))
This makes it even worse.
> Which brings us back to the `decorate` form, which reduces nestedness:
>
> ```scheme
> (decorate (install-foo
> install-bar
> install-zfs
> operating-system)
> #;...)
Better but still don't like it.
Can't we put the os declaration into a variable and then pass it to a
procedure?
Say:
> ```scheme
> (define OS
> (operating-system
> (kernel linux-libre-5.4)
> ; ... other fields ...
> ))
>
> (install-zfs OS)
> (install-foo OS)
> (install-bar OS)
> (install-something OS)
>
> ```
> Thanks
> raid5atemyhomework
>
Jan Wielkiewicz