[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Happy birthday, Guile!
From: |
Christopher Lam |
Subject: |
Re: Happy birthday, Guile! |
Date: |
Tue, 18 Feb 2020 13:38:37 +0000 |
A bit late, and perhaps not as sophisticated as some bigger modules here.
Two functions defined as follows: nested-alist-set! nested-alist-get at
https://github.com/Gnucash/gnucash/blob/1f83cfaf64d1cd3c8862b427dd043154f780a772/gnucash/report/html-chart.scm#L37
Consider a nested alist describing unix file system
(define lst
(list
(cons 'usr (list
(cons 'bin "binary files")
(cons 'games "g4m3s")
(cons 'include (list
(cons 'guile (list
(cons '2.2 "old")))
(cons 'linux "da best")))))))
We can access a leaf node via (nested-alist-get lst '(usr include linux))
--> "da best", and set a leaf node via (nested-alist-set! lst '(usr include
python) "boo"). This is probably easy to seasoned schemers, but still a
nice pair of functions to use in modifying nested alists before conversion
into json.
On Mon, 17 Feb 2020 at 09:16, Ludovic Courtès <address@hidden> wrote:
> Hi!
>
> Ricardo Wurmus <address@hidden> skribis:
>
> > What do you think about adding these things to
> > https://notabug.org/cwebber/guile-webutils/ ? This was once intended to
> > be a collection of useful tools that come in handy when writing web
> > applications.
>
> I didn’t know about guile-webutils but consolidating Web tools in this
> package sounds like a great idea!
>
> Ludo’.
>
>
- Happy birthday, Guile!, Ludovic Courtès, 2020/02/16
- Re: Happy birthday, Guile!, Linus Björnstam, 2020/02/16
- Re: Happy birthday, Guile!, Arun Isaac, 2020/02/16
- Re: Happy birthday, Guile!, Roel Janssen, 2020/02/16
- Re: Happy birthday, Guile!, Ricardo Wurmus, 2020/02/16
- Re: Happy birthday, Guile!, Ludovic Courtès, 2020/02/17
- Re: Happy birthday, Guile!,
Christopher Lam <=
- Lenses in Guile?, Zelphir Kaltstahl, 2020/02/18
- Re: Lenses in Guile?, Alex Sassmannshausen, 2020/02/18
- Re: Lenses in Guile?, Zelphir Kaltstahl, 2020/02/19
- Re: Lenses in Guile?, Ludovic Courtès, 2020/02/23
Re: Happy birthday, Guile!, Mike Gran, 2020/02/16
Re: Happy birthday, Guile!, Ricardo Wurmus, 2020/02/16
Re: Happy birthday, Guile!, Jeremy Korwin-Zmijowski, 2020/02/16
potluck; Re: Happy birthday, Guile!, Arne Babenhauserheide, 2020/02/16
Re: Happy birthday, Guile! - grid printing, Zelphir Kaltstahl, 2020/02/16