guix-devel
[Top][All Lists]
Advanced

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

Re: WSDD Service Module


From: Ludovic Courtès
Subject: Re: WSDD Service Module
Date: Mon, 24 Jan 2022 16:46:44 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Hi,

Simon Streit <simon@netpanic.org> skribis:

> Unfortunately while preparing its service, there is this one part that
> I'm having trouble trying to get working:
>
> #$(if interface
>       #~(for-each (lambda (arg)
>                     (display (string-append "--interface" arg))
>                     ;; (format #t "--interface ~a " (list->string arg))
>                     )
>                   #$(interface))
>       '())
>
> Which is the main intention for this post: I'd really appreciate a little
> hint on how to solve this small problem.  Everything else looks okay.

My understanding is that you intend the ‘interface’ field to be either
#f or a string, is that right?

When you write:

  (interface)

that means: “call the procedure bound to ‘interface’, passing it zero
arguments”.  However, if ‘interface’ is a string, you cannot call it, so
you get a wrong-type-to-apply error.

Likewise, ‘for-each’ expects its second argument to be a list.  But
here, ‘interface’ is supposedly a string, not a list, so if you do:

  (for-each (lambda …) interface)

you’ll get a wrong-type-argument error.

HTH!

Ludo’.



reply via email to

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