[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: string-append *IS* broken!!!
From: |
Bruce Korb |
Subject: |
Re: string-append *IS* broken!!! |
Date: |
Tue, 30 Dec 2003 18:30:05 -0800 |
Who in heck told string-append it "okay" to not do its job if the
first string appeared to be quoted? That is utterly disgusting
and completely counter-intuitive. How can you do that? That
function has absolutely *NO* business trying to understand the
contents of the strings I want to concatenate together.
Bruce Korb wrote:
>
> Why is this code "wrong"?
>
> > (string-append (c-string (get "name")) ", ")
>
> As an experiment, I did this:
>
> (define c-str (c-string (get "name")))
> (shellf "echo 'c-str is set to -->%s<--' >&2" c-str)
> (set! c-str (string-append c-str ", "))
> (shellf "echo 'c-str is set to -->%s<--' >&2" c-str)
>
> Here is the result:
>
> autogen -T getopt.tpl getpwnam-opts.def
> c-str is set to -->"name"<--
> c-str is set to -->"name"<--
> c-str is set to -->"passwd"<--
> c-str is set to -->"passwd"<--
> c-str is set to -->"uid"<--
> c-str is set to -->"uid"<--
> c-str is set to -->"gname"<--
> c-str is set to -->"gname"<--
>
> This works:
>
> (sprintf "%s, " (c-string (get "name")))
>
> but should not be any different.....Am I confused or is this a bug?