guile-devel
[Top][All Lists]
Advanced

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

Is string-append broken?


From: Bruce Korb
Subject: Is string-append broken?
Date: Tue, 30 Dec 2003 18:08:42 -0800

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?




reply via email to

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