On Thu, 14 Jul 2011 12:30:24 +0100, Steven Schveighoffer
wrote:
On Thu, 14 Jul 2011 05:53:47 -0400, Regan Heath
wrote:
On Wed, 13 Jul 2011 19:31:42 +0100, Steven Schveighoffer
wrote:
On Wed, 13 Jul 2011 13:32:56 -0400, Regan Heath
wrote:
On Wed, 13 Jul 2011 17:00:39 +0100, Steven
On Thu, 14 Jul 2011 05:53:47 -0400, Regan Heath
wrote:
On Wed, 13 Jul 2011 19:31:42 +0100, Steven Schveighoffer
wrote:
On Wed, 13 Jul 2011 13:32:56 -0400, Regan Heath
wrote:
On Wed, 13 Jul 2011 17:00:39 +0100, Steven Schveighoffer
wrote:
How does your proposal know that a char *
On Wed, 13 Jul 2011 19:31:42 +0100, Steven Schveighoffer
wrote:
On Wed, 13 Jul 2011 13:32:56 -0400, Regan Heath
wrote:
On Wed, 13 Jul 2011 17:00:39 +0100, Steven Schveighoffer
wrote:
How does your proposal know that a char * is part of a heap-allocated
array? If you are assuming t
On Wed, 13 Jul 2011 13:32:56 -0400, Regan Heath
wrote:
On Wed, 13 Jul 2011 17:00:39 +0100, Steven Schveighoffer
wrote:
How does your proposal know that a char * is part of a heap-allocated
array? If you are assuming the only case where char * is passed will
be arr.ptr, then that does
On Wed, 13 Jul 2011 17:00:39 +0100, Steven Schveighoffer
wrote:
On Wed, 13 Jul 2011 10:59:27 -0400, Regan Heath
wrote:
I am suggesting the compiler will perform a special operation on all
char* parameters passed to extern "C" functions.
The operation is a toStringz like operation whic
On 2011-07-13 09:00, Steven Schveighoffer wrote:
> On Wed, 13 Jul 2011 10:59:27 -0400, Regan Heath
>
> wrote:
> > I am suggesting the compiler will perform a special operation on all
> > char* parameters passed to extern "C" functions.
> >
> > The operation is a toStringz like operation which is
On Wed, 13 Jul 2011 10:59:27 -0400, Regan Heath
wrote:
I am suggesting the compiler will perform a special operation on all
char* parameters passed to extern "C" functions.
The operation is a toStringz like operation which is (more or less) as
follows:
1. If there is a \0 character i
Ok, it's clear there has been some confusion over what exactly I am
suggesting.
I am not suggesting the compiler simply insert calls to the existing
toStringz function as it appears the function does not, or cannot do what
I am imagining.
I am suggesting the compiler will perform a specia
On Tue, 12 Jul 2011 13:00:41 -0400, Regan Heath
wrote:
On Tue, 12 Jul 2011 17:09:04 +0100, Steven Schveighoffer
wrote:
On Tue, 12 Jul 2011 11:41:56 -0400, Regan Heath
wrote:
On Tue, 12 Jul 2011 15:59:58 +0100, Steven Schveighoffer
wrote:
On Tue, 12 Jul 2011 10:50:07 -0400, Regan
Gah.. bad grammar.. 1/2 baked sentences..
On Tue, 12 Jul 2011 18:00:41 +0100, Regan Heath
wrote:
On Tue, 12 Jul 2011 17:09:04 +0100, Steven Schveighoffer
wrote:
No, it wouldn't compile. char[] does not cast implicitly to char *.
(if it does, that needs to change).
Replace foo with foo
On Tue, 12 Jul 2011 17:09:04 +0100, Steven Schveighoffer
wrote:
On Tue, 12 Jul 2011 11:41:56 -0400, Regan Heath
wrote:
On Tue, 12 Jul 2011 15:59:58 +0100, Steven Schveighoffer
wrote:
On Tue, 12 Jul 2011 10:50:07 -0400, Regan Heath
wrote:
What if you expect the function is expect
On Tue, 12 Jul 2011 11:41:56 -0400, Regan Heath
wrote:
On Tue, 12 Jul 2011 15:59:58 +0100, Steven Schveighoffer
wrote:
On Tue, 12 Jul 2011 10:50:07 -0400, Regan Heath
wrote:
What if you expect the function is expecting to write to the buffer,
and the compiler just made a copy of it
On Tue, 12 Jul 2011 16:04:15 +0100, Steven Schveighoffer
wrote:
On Tue, 12 Jul 2011 10:59:58 -0400, Steven Schveighoffer
wrote:
On Tue, 12 Jul 2011 10:50:07 -0400, Regan Heath
wrote:
and in both cases, toStringz would do nothing as foo is zero
terminated already (in both cases), or
On Tue, 12 Jul 2011 15:59:58 +0100, Steven Schveighoffer
wrote:
On Tue, 12 Jul 2011 10:50:07 -0400, Regan Heath
wrote:
What if you expect the function is expecting to write to the buffer,
and the compiler just made a copy of it? Won't that be pretty
surprising?
Assuming a C functio
On Tue, 12 Jul 2011 10:59:58 -0400, Steven Schveighoffer
wrote:
On Tue, 12 Jul 2011 10:50:07 -0400, Regan Heath
wrote:
and in both cases, toStringz would do nothing as foo is zero terminated
already (in both cases), or am I wrong about that?
In neither case are they required to be nul
On Tue, 12 Jul 2011 10:50:07 -0400, Regan Heath
wrote:
On Tue, 12 Jul 2011 15:18:04 +0100, Steven Schveighoffer
wrote:
On Tue, 12 Jul 2011 09:54:15 -0400, Regan Heath
wrote:
On Fri, 08 Jul 2011 18:59:47 +0100, Walter Bright
wrote:
On 7/8/2011 4:53 AM, Regan Heath wrote:
On Fri,
On Tue, 12 Jul 2011 15:18:04 +0100, Steven Schveighoffer
wrote:
On Tue, 12 Jul 2011 09:54:15 -0400, Regan Heath
wrote:
On Fri, 08 Jul 2011 18:59:47 +0100, Walter Bright
wrote:
On 7/8/2011 4:53 AM, Regan Heath wrote:
On Fri, 08 Jul 2011 10:49:08 +0100, Walter Bright
wrote:
On 7
On Tue, 12 Jul 2011 09:54:15 -0400, Regan Heath
wrote:
On Fri, 08 Jul 2011 18:59:47 +0100, Walter Bright
wrote:
On 7/8/2011 4:53 AM, Regan Heath wrote:
On Fri, 08 Jul 2011 10:49:08 +0100, Walter Bright
wrote:
On 7/8/2011 2:26 AM, Regan Heath wrote:
Why can't we have the
compiler c
On Fri, 08 Jul 2011 18:59:47 +0100, Walter Bright
wrote:
On 7/8/2011 4:53 AM, Regan Heath wrote:
On Fri, 08 Jul 2011 10:49:08 +0100, Walter Bright
wrote:
On 7/8/2011 2:26 AM, Regan Heath wrote:
Why can't we have the
compiler call it automatically whenever we pass a string, or char[]
On 7/8/2011 4:53 AM, Regan Heath wrote:
On Fri, 08 Jul 2011 10:49:08 +0100, Walter Bright
wrote:
On 7/8/2011 2:26 AM, Regan Heath wrote:
Why can't we have the
compiler call it automatically whenever we pass a string, or char[] to an extern
"C" function, where the parameter is defined as char*
On 2011-07-08 07:03, SimonM wrote:
> This is kind of off-topic, and I don't know if it's just me, but I've
> barely been able to use toStringz() where it's supposed to be useful:
>
> I tried using it with a C function whose parameters are not
> const(char)*, but just char*, but because it returns
On 7/8/2011 11:03 PM, SimonM wrote:
This is kind of off-topic, and I don't know if it's just me, but I've
barely been able to use toStringz() where it's supposed to be useful:
I tried using it with a C function whose parameters are not
const(char)*, but just char*, but because it returns immutab
This is kind of off-topic, and I don't know if it's just me, but I've
barely been able to use toStringz() where it's supposed to be useful:
I tried using it with a C function whose parameters are not
const(char)*, but just char*, but because it returns immutable(char)'s I
had to write my own o
On Fri, 08 Jul 2011 07:53:20 -0400, Regan Heath
wrote:
On Fri, 08 Jul 2011 10:49:08 +0100, Walter Bright
wrote:
On 7/8/2011 2:26 AM, Regan Heath wrote:
Why can't we have the
compiler call it automatically whenever we pass a string, or char[] to
an extern
"C" function, where the param
On Fri, 08 Jul 2011 10:49:08 +0100, Walter Bright
wrote:
On 7/8/2011 2:26 AM, Regan Heath wrote:
Why can't we have the
compiler call it automatically whenever we pass a string, or char[] to
an extern
"C" function, where the parameter is defined as char*?
Because char* in C does not nece
On 7/8/2011 2:26 AM, Regan Heath wrote:
Why can't we have the
compiler call it automatically whenever we pass a string, or char[] to an extern
"C" function, where the parameter is defined as char*?
Because char* in C does not necessarily mean "zero terminated string".
Sorry if this has been asked/answered before but I've been out of the loop
for a while..
I was just thinking about the recent discussion on renaming toStringz and
I wondered why we need to explicitly call it at all. Why can't we have
the compiler call it automatically whenever we pass a st
27 matches
Mail list logo