chicken-users
[Top][All Lists]
Advanced

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

Re: Pass argument to function


From: Kristian Lein-Mathisen
Subject: Re: Pass argument to function
Date: Fri, 10 Mar 2023 17:08:53 +0100


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 installation.

~> rlwrap csi
#;1> (list "a" "b")
("a" "b")
#;2> (list "a" (string-append "b" "c"))
("a" "bc")


K.

On Fri, Mar 10, 2023, 15:15 Brandon Booth <Bbooth@protonmail.com> wrote:
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))

This doesn't:
(define (inspect str)
    (capture (string-append "docker inspect " str)))

I get an error that string-append is not found. How do a call capture with the result of string-append?

Thanks.

Brandon



reply via email to

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