chicken-users
[Top][All Lists]
Advanced

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

Re: Pass argument to function


From: ipcore
Subject: Re: Pass argument to function
Date: Fri, 10 Mar 2023 17:21:57 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1

Hi Brandon,

'capture' and its friends 'run' and 'run*' are macros that treat their arguments differently from what you would expect from a regular procedure.

Looking at the documentation of '(run COMMAND ...)', you will find that

 COMMAND is also implicitly quasiquoted so subexpressions may be computed at 
run-time by unquoting them.

which means that COMMAND is passed to the shell as-is, without being evaluated. So the "not found" error is actually returned by the shell, since it does not know what 'string-append' is.

In order to evaluate a quasi-quoted expression (or parts of it), you must unquote it (or the parts in question).
This should work:

(capture ,(string-append "docker inspect " str)))

Hope that helps.

Best wishes,
-utz



reply via email to

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