unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Is string-append broken?
@ 2003-12-31  2:08 Bruce Korb
  2003-12-31  2:30 ` string-append *IS* broken!!! Bruce Korb
  2003-12-31  8:56 ` Is string-append broken? Marius Vollmer
  0 siblings, 2 replies; 5+ messages in thread
From: Bruce Korb @ 2003-12-31  2:08 UTC (permalink / raw)


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?


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-12-31 23:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-31  2:08 Is string-append broken? Bruce Korb
2003-12-31  2:30 ` string-append *IS* broken!!! Bruce Korb
2003-12-31  8:57   ` Marius Vollmer
2003-12-31 23:41     ` string-append is *NOT* broken!!! Bruce Korb
2003-12-31  8:56 ` Is string-append broken? Marius Vollmer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).