unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Bruce Korb <bkorb@veritas.com>
Subject: Is string-append broken?
Date: Tue, 30 Dec 2003 18:08:42 -0800	[thread overview]
Message-ID: <3FF22FAA.FD22BC73@veritas.com> (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


             reply	other threads:[~2003-12-31  2:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-31  2:08 Bruce Korb [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3FF22FAA.FD22BC73@veritas.com \
    --to=bkorb@veritas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).