caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jon Harrop <jon@ffconsultancy.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Concatenation of static strings?
Date: Sat, 26 Jan 2008 16:13:51 +0000	[thread overview]
Message-ID: <200801261613.51858.jon@ffconsultancy.com> (raw)
In-Reply-To: <d8be5ae20801241502q5190bcceje287e1f224d5648a@mail.gmail.com>

On Thursday 24 January 2008 23:02:48 Ashish Agarwal wrote:
> I was hoping there would be some follow up discussion on the code below,
> but haven't seen anything yet. Can someone please clarify why this is not
> considered a bug (or is it).

This is not considered a bug. String literals are static but array literals 
are not.

> Given that s is locally scoped within f, I do not see why f returns
> different answers. 

A static local remains the same between calls (so it is not thread-safe).

This has been discussed before several times. The reason given more making 
strings static is performance.

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?e


  parent reply	other threads:[~2008-01-26 16:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-19  3:32 Erik de Castro Lopo
2008-01-19  6:50 ` [Caml-list] " David Allsopp
2008-01-19  7:36   ` Erik de Castro Lopo
2008-01-19 10:55 ` David Baelde
2008-01-24 23:02   ` Ashish Agarwal
2008-01-25  1:57     ` Oliver Bandel
2008-01-25 10:47       ` Loup Vaillant
2008-01-26 13:27         ` Ashish Agarwal
2008-01-26 16:13     ` Jon Harrop [this message]
2008-01-26 19:58       ` Oliver Bandel

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

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

  git send-email \
    --in-reply-to=200801261613.51858.jon@ffconsultancy.com \
    --to=jon@ffconsultancy.com \
    --cc=caml-list@yquem.inria.fr \
    /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 NNTP newsgroup(s).