guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] gnu: sdl-union: Wrap into a procedure and export it.


From: Ludovic Courtès
Subject: Re: [PATCH] gnu: sdl-union: Wrap into a procedure and export it.
Date: Sun, 11 Oct 2015 18:50:39 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Alex Kost <address@hidden> skribis:

> From f1bd9edbbae498fb3b4726428daf523e3fd83060 Mon Sep 17 00:00:00 2001
> From: Alex Kost <address@hidden>
> Date: Sat, 10 Oct 2015 11:27:27 +0300
> Subject: [PATCH] gnu: sdl-union: Wrap into a procedure and export it.
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> Suggested by Ludovic Courtès <address@hidden>.
>
> * gnu/packages/sdl.scm (sdl-union): Make it a procedure returning
>   'sdl-union' package.
>   (guile-sdl): Use it.

I like this idea.

> +(define (sdl-union . sdl-packages)
> +  "Return 'sdl-union' package that is the union of SDL-PACKAGES.
> +If SDL-PACKAGES are not specified, all SDL libraries are used."
> +  (let* ((sdl-packages (if (null? sdl-packages)
> +                           (list sdl
> +                                 sdl-gfx
> +                                 sdl-image
> +                                 sdl-mixer
> +                                 sdl-net
> +                                 sdl-ttf)
> +                           sdl-packages))

What about writing it like this:

  (define* (sdl-union #:optional (packages (list sdl sdl-gfx …)))
    …)

That would be more concise and more idiomatic.

If that’s fine with you, OK to push with this change.

Thanks!

Ludo’.



reply via email to

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