Re: Pass argument to function

2023-03-11 Thread ipcore
You actually don't even need string-append here. The following should also work: (capture (docker inspect ,str)) Best wishes, -utz

Re: Pass argument to function

2023-03-10 Thread Brandon Booth
Unquoting worked! I spent so much time trying different variations and this worked: (capture ,(string-append "docker inspect " str))) Thanks. Brandon

Re: Pass argument to function

2023-03-10 Thread Nevroz Arslan
You're right. I confused characters , with ` during typing in the editor. Sorry for misunderstanding at my part. Am Fr., 10. März 2023 um 20:36 Uhr schrieb : > > > >> (capture ,(string-append "docker inspect " str))) > > doesn't work because of the same reason that you expressed. > > You would

Re: Pass argument to function

2023-03-10 Thread Mario Domenech Goulart
On Fri, 10 Mar 2023 20:15:13 +0300 Nevroz Arslan wrote: >> (capture ,(string-append "docker inspect " str))) > doesn't work because of the same reason that you expressed. > You would get "quasiquote not found" from the shell. Actually, no: $ csi -R shell -p '(capture ,(string-append "echo"

Re: Pass argument to function

2023-03-10 Thread ipcore
(capture ,(string-append "docker inspect " str))) doesn't work because of the same reason that you expressed. You would get "quasiquote not found" from the shell. Yes, it does, and no, you don't get "quasiquote not found" from this.

Re: Pass argument to function

2023-03-10 Thread Nevroz Arslan
Hi utz and Brandon, > (capture ,(string-append "docker inspect " str))) doesn't work because of the same reason that you expressed. You would get "quasiquote not found" from the shell. As a workaround, execute procedure might be used straightly. (define (inspect str) (execute (list

Re: Pass argument to function

2023-03-10 Thread ipcore
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

Re: Pass argument to function

2023-03-10 Thread Kristian Lein-Mathisen
Hi Brandon, What you are doing looks right to me. What exactly is the error message? "string-append" is automaticalli imported, so it should be available without any imports. Perhaps you redifined "string-append" elsewhere in your code? If not, there may me a problem with your CHICKEN

Pass argument to function

2023-03-10 Thread Brandon Booth
I'm trying to learn Chicken and having issues. I'm trying to create a function that takes a docker container name and runs "docker inspect [container]." This works: (define test (capture "docker inspect hello-world")) This works: (define (str-concat str) (string-append "docker inspect " str))