guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#55220] [PATCH 0/4] Add --list-systems and --list-targets options.


From: Ludovic Courtès
Subject: [bug#55220] [PATCH 0/4] Add --list-systems and --list-targets options.
Date: Fri, 06 May 2022 16:41:50 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Mathieu Othacehe <othacehe@gnu.org> skribis:

> * gnu/platform.scm (platform-modules, systems, targets): New procedures.
> (%platforms): New variable.
>
> Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>

[...]

> +(define %platforms
> +  ;; The list of publically-known platforms.
> +  (delay (fold-module-public-variables (lambda (obj result)
> +                                         (if (platform? obj)
> +                                             (cons obj result)
> +                                             result))
> +                                       '()
> +                                       (platform-modules))))

Maybe expose it as a memoizing procedure thunk called ‘platforms’, for
consistency with the names ‘systems’ and ‘targets’.

> +
> +;;;
> +;;; Systems & Targets.
> +;;;
> +
> +(define (systems)
> +  "Return the list of supported systems."
> +  (delete-duplicates
> +   (filter-map platform-system (force %platforms))))
> +
> +(define (targets)
> +  "Return the list of supported targets."
> +  (map platform-target (force %platforms)))

Or ‘supported-systems’ and ‘supported-targets’?

Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]