Am Wed, 16 May 2012 09:18:38 -0400
schrieb "Steven Schveighoffer" :
> Regardless, we should fix if(!arr) to mean if(!arr.length).
>
> -Steve
I'm still using 2.057 (GDC). My mental model of D tells me: A reference type's
pointer is implicitly converted to bool, when used inside an if-expression.
On Thu, 17 May 2012 00:08:49 +0100, Jonathan M Davis
wrote:
On Wednesday, May 16, 2012 09:18:38 Steven Schveighoffer wrote:
but I still think we should discourage using null as a
sentinel, it leads to confusing code.
If null were actually properly differentiated from empty, then this
wou
Le 16/05/2012 23:15, Steven Schveighoffer a écrit :
On Wed, 16 May 2012 17:11:58 -0400, deadalnix wrote:
Le 16/05/2012 15:12, Steven Schveighoffer a écrit :
On Tue, 15 May 2012 04:42:10 -0400, deadalnix
wrote:
Le 14/05/2012 21:53, Steven Schveighoffer a écrit :
On Mon, 14 May 2012 15:30:2
On Wednesday, May 16, 2012 09:18:38 Steven Schveighoffer wrote:
> but I still think we should discourage using null as a
> sentinel, it leads to confusing code.
If null were actually properly differentiated from empty, then this wouldn't be
a problem, but it's not. It _should_ be possible to trea
On Wed, 16 May 2012 17:11:58 -0400, deadalnix wrote:
Le 16/05/2012 15:12, Steven Schveighoffer a écrit :
On Tue, 15 May 2012 04:42:10 -0400, deadalnix
wrote:
Le 14/05/2012 21:53, Steven Schveighoffer a écrit :
On Mon, 14 May 2012 15:30:25 -0400, deadalnix
wrote:
Le 14/05/2012 16:37, S
Le 16/05/2012 15:12, Steven Schveighoffer a écrit :
On Tue, 15 May 2012 04:42:10 -0400, deadalnix wrote:
Le 14/05/2012 21:53, Steven Schveighoffer a écrit :
On Mon, 14 May 2012 15:30:25 -0400, deadalnix
wrote:
Le 14/05/2012 16:37, Steven Schveighoffer a écrit :
Note that [] is a request t
On 05/16/2012 04:23 PM, bearophile wrote:
Is this request in Bugzilla?
http://d.puremagic.com/issues/show_bug.cgi?id=4733
http://d.puremagic.com/issues/show_bug.cgi?id=7539
The first report happens to be yours =).
On Wednesday, 16 May 2012 at 14:26:49 UTC, Alex Rønne Petersen
wrote:
On 16-05-2012 16:23, bearophile wrote:
Steven Schveighoffer:
Regardless, we should fix if(!arr) to mean if(!arr.length).
This seems a nice idea (and Python programmers will be
thankful, because
they are used to empty coll
On 16-05-2012 16:23, bearophile wrote:
Steven Schveighoffer:
Regardless, we should fix if(!arr) to mean if(!arr.length).
This seems a nice idea (and Python programmers will be thankful, because
they are used to empty collections/strings to be false). Is this request
in Bugzilla? Are people op
Steven Schveighoffer:
Regardless, we should fix if(!arr) to mean if(!arr.length).
This seems a nice idea (and Python programmers will be thankful,
because they are used to empty collections/strings to be false).
Is this request in Bugzilla? Are people opposed to this little D
breaking chang
On Mon, 14 May 2012 18:07:24 -0400, Timon Gehr wrote:
On 05/14/2012 01:51 PM, deadalnix wrote:
Le 14/05/2012 12:49, Gor Gyolchanyan a écrit :
So, null arrays and empty arrays are always the same, except for an
empty string, which is a valid non-nill array of characters with length
0, right?
On Tue, 15 May 2012 04:42:10 -0400, deadalnix wrote:
Le 14/05/2012 21:53, Steven Schveighoffer a écrit :
On Mon, 14 May 2012 15:30:25 -0400, deadalnix
wrote:
Le 14/05/2012 16:37, Steven Schveighoffer a écrit :
Note that [] is a request to the runtime to build an empty array. The
runtime
On Wednesday, May 16, 2012 00:48:44 Gor Gyolchanyan wrote:
> No, no and no. toUTFz could be called at compile-time. Absolutely no extra
> run-time allocations, absolutely no run-time overhead.
So, you're going to create a bunch of enums just to pass string literals to C
functions? Stuff like this
On 5/15/12, Gor Gyolchanyan wrote:
> No, no and no. toUTFz could be called at compile-time. Absolutely no extra
> run-time allocations, absolutely no run-time overhead.
How about programmer-time overhead? Are *you* volunteering to edit all
the codebases out there that rely on having 0-terminated
Le 15/05/2012 15:29, Alex Rønne Petersen a écrit :
On 15-05-2012 15:22, Gor Gyolchanyan wrote:
On Tue, May 15, 2012 at 4:00 PM, Alex Rønne Petersen
mailto:xtzgzo...@gmail.com>> wrote:
Yes, because using a Phobos function in druntime is perfectly
possible! Totally!
--
- Alex
Isn't it obvious
No, no and no. toUTFz could be called at compile-time. Absolutely no extra
run-time allocations, absolutely no run-time overhead.
On Tue, May 15, 2012 at 11:05 PM, Jonathan M Davis wrote:
> On Tuesday, May 15, 2012 17:35:58 Gor Gyolchanyan wrote:
> > Even if it's wrong to move writef to druntime,
On Tuesday, May 15, 2012 17:35:58 Gor Gyolchanyan wrote:
> Even if it's wrong to move writef to druntime, the toUTFz is still a very
> small word to write.
Using toStringz or toUTFz instead of having string literals be zero-terminated
would force allocating extra strings (string literals are in a
On 05/15/2012 12:09 PM, Gor Gyolchanyan wrote:
There's not reason to use printf! This is ridiculous! We haev a
type-safe writef, which does exactly that and does it better.
Besides, wrapping the literal into a toUTFz is not too difficult!
UTF manipulation functions are fundamental enough, because all of D's
strings are UTF-something.
I think std.utf deserves to be in druntime.
On Tue, May 15, 2012 at 6:05 PM, Alex Rønne Petersen wrote:
> On 15-05-2012 15:35, Gor Gyolchanyan wrote:
>
>> Even if it's wrong to move writef to druntime
On 15-05-2012 15:35, Gor Gyolchanyan wrote:
Even if it's wrong to move writef to druntime, the toUTFz is still a
very small word to write.
On Tue, May 15, 2012 at 5:29 PM, Alex Rønne Petersen
mailto:xtzgzo...@gmail.com>> wrote:
On 15-05-2012 15:22, Gor Gyolchanyan wrote:
On Tue, Ma
Even if it's wrong to move writef to druntime, the toUTFz is still a very
small word to write.
On Tue, May 15, 2012 at 5:29 PM, Alex Rønne Petersen wrote:
> On 15-05-2012 15:22, Gor Gyolchanyan wrote:
>
>> On Tue, May 15, 2012 at 4:00 PM, Alex Rønne Petersen
>> mailto:xtzgzo...@gmail.com>> wrote:
On 15-05-2012 15:22, Gor Gyolchanyan wrote:
On Tue, May 15, 2012 at 4:00 PM, Alex Rønne Petersen
mailto:xtzgzo...@gmail.com>> wrote:
Yes, because using a Phobos function in druntime is perfectly
possible! Totally!
--
- Alex
Isn't it obvious what needs to be done? Come on, it
On Tue, May 15, 2012 at 4:00 PM, Alex Rønne Petersen wrote:
>
> Yes, because using a Phobos function in druntime is perfectly possible!
> Totally!
> --
> - Alex
>
Isn't it obvious what needs to be done? Come on, it's no too hard to see...
--
Bye,
Gor Gyolchanyan.
On 15-05-2012 12:09, Gor Gyolchanyan wrote:
There's not reason to use printf! This is ridiculous! We haev a
type-safe writef, which does exactly that and does it better.
Besides, wrapping the literal into a toUTFz is not too difficult!
On Tue, May 15, 2012 at 2:15 AM, Timon Gehr mailto:timon.g..
On Tue, May 15, 2012 at 2:34 AM, Jonathan M Davis wrote:
> On Tuesday, May 15, 2012 00:48:41 Gor Gyolchanyan wrote:
> > >> P.S. Please don't top-post. It's bad etiquette and makes posts harder
> to
> > >> follow.
> >
> > It's not me. It's how gmail works.
>
> Just because gmail puts your cursor at
There's not reason to use printf! This is ridiculous! We haev a type-safe
writef, which does exactly that and does it better.
Besides, wrapping the literal into a toUTFz is not too difficult!
On Tue, May 15, 2012 at 2:15 AM, Timon Gehr wrote:
> On 05/14/2012 07:16 PM, Gor Gyolchanyan wrote:
>
>>
Le 14/05/2012 21:53, Steven Schveighoffer a écrit :
On Mon, 14 May 2012 15:30:25 -0400, deadalnix wrote:
Le 14/05/2012 16:37, Steven Schveighoffer a écrit :
Note that [] is a request to the runtime to build an empty array. The
runtime detects this, and rather than consuming a heap allocation
On Tuesday, May 15, 2012 00:48:41 Gor Gyolchanyan wrote:
> >> P.S. Please don't top-post. It's bad etiquette and makes posts harder to
> >> follow.
>
> It's not me. It's how gmail works.
Just because gmail puts your cursor at the top of your reply by default
doesn't mean that you have to write y
On 05/14/2012 07:16 PM, Gor Gyolchanyan wrote:
At least we could make an empty string a null array of characters for
consistency. How many times did anyone use the feature of string
literals being null-terminated?
It is a useful feature. There is no reason to break
printf("Hello, World!");
On 05/14/2012 01:51 PM, deadalnix wrote:
Le 14/05/2012 12:49, Gor Gyolchanyan a écrit :
So, null arrays and empty arrays are always the same, except for an
empty string, which is a valid non-nill array of characters with length
0, right?
If it is the current behavior, it deserve a WAT !
I a
>> P.S. Please don't top-post. It's bad etiquette and makes posts harder to
follow.
It's not me. It's how gmail works.
On Tue, May 15, 2012 at 12:12 AM, Jonathan M Davis wrote:
> On Monday, May 14, 2012 21:16:21 Gor Gyolchanyan wrote:
> > At least we could make an empty string a null array of ch
On Monday, May 14, 2012 21:16:21 Gor Gyolchanyan wrote:
> At least we could make an empty string a null array of characters for
> consistency.
It's completely consintent. If there is memory allocated for the array, then
it's ptr property is non-null, and then the array is non-null per the is
ope
On Mon, 14 May 2012 15:30:25 -0400, deadalnix wrote:
Le 14/05/2012 16:37, Steven Schveighoffer a écrit :
Note that [] is a request to the runtime to build an empty array. The
runtime detects this, and rather than consuming a heap allocation to
build nothing, it simply returns a null-pointed ar
Le 14/05/2012 16:37, Steven Schveighoffer a écrit :
Note that [] is a request to the runtime to build an empty array. The
runtime detects this, and rather than consuming a heap allocation to
build nothing, it simply returns a null-pointed array. This is 100% the
right decision, and I don't think
This is the original thread and there's no reply from you prior to this one.
On Mon, May 14, 2012 at 9:41 PM, Alex Rønne Petersen wrote:
> On 14-05-2012 19:16, Gor Gyolchanyan wrote:
>
>> At least we could make an empty string a null array of characters for
>> consistency. How many times did anyo
On 14-05-2012 19:16, Gor Gyolchanyan wrote:
At least we could make an empty string a null array of characters for
consistency. How many times did anyone use the feature of string
literals being null-terminated?
On Mon, May 14, 2012 at 8:56 PM, Jonathan M Davis mailto:jmdavisp...@gmx.com>> wrote:
At least we could make an empty string a null array of characters for
consistency. How many times did anyone use the feature of string literals
being null-terminated?
On Mon, May 14, 2012 at 8:56 PM, Jonathan M Davis wrote:
> On Monday, May 14, 2012 14:08:17 Gor Gyolchanyan wrote:
> > Hi! I have
On Monday, May 14, 2012 14:08:17 Gor Gyolchanyan wrote:
> Hi! I have a small question:
> Is the test for a null array equivalent to a test for zero-length array?
> This is particularly interesting for strings.
> For instance, I could return an empty string from a toString-like function
> and the em
On Mon, 14 May 2012 06:08:17 -0400, Gor Gyolchanyan
wrote:
Hi! I have a small question:
Is the test for a null array equivalent to a test for zero-length array?
== tests for length and content equivalence.
'is' tests for both pointer and length equivalence (and therefore, content
equalit
No, it doesn't. Appending to a null array is equivalent to allocating a new
array.
On Mon, May 14, 2012 at 6:29 PM, H. S. Teoh wrote:
> On Mon, May 14, 2012 at 05:00:25PM +0400, Gor Gyolchanyan wrote:
> > I think any kind of null array should be different from an array of
> > zero length.
>
> Bu
On Mon, May 14, 2012 at 05:00:25PM +0400, Gor Gyolchanyan wrote:
> I think any kind of null array should be different from an array of
> zero length.
But that defeats the utility of idioms like:
int[] arr;
arr ~= 123;
...
T
--
There are four kinds of lies: lies, damn l
I think any kind of null array should be different from an array of zero
length.
On Mon, May 14, 2012 at 3:55 PM, simendsjo wrote:
> On Mon, 14 May 2012 13:51:40 +0200, deadalnix wrote:
>
> Le 14/05/2012 12:49, Gor Gyolchanyan a écrit :
>>
>>> So, null arrays and empty arrays are always the sa
On Mon, 14 May 2012 13:51:40 +0200, deadalnix wrote:
Le 14/05/2012 12:49, Gor Gyolchanyan a écrit :
So, null arrays and empty arrays are always the same, except for an
empty string, which is a valid non-nill array of characters with length
0, right?
If it is the current behavior, it deserve
Le 14/05/2012 12:49, Gor Gyolchanyan a écrit :
So, null arrays and empty arrays are always the same, except for an
empty string, which is a valid non-nill array of characters with length
0, right?
If it is the current behavior, it deserve a WAT !
So, null arrays and empty arrays are always the same, except for an empty
string, which is a valid non-nill array of characters with length 0, right?
On Mon, May 14, 2012 at 2:24 PM, simendsjo wrote:
> On Mon, 14 May 2012 12:08:17 +0200, Gor Gyolchanyan <
> gor.f.gyolchan...@gmail.com> wrote:
>
On Mon, 14 May 2012 12:08:17 +0200, Gor Gyolchanyan
wrote:
Hi! I have a small question:
Is the test for a null array equivalent to a test for zero-length array?
This is particularly interesting for strings.
For instance, I could return an empty string from a toString-like
function
and the
On Mon, 14 May 2012 12:08:17 +0200, Gor Gyolchanyan
wrote:
Hi! I have a small question:
Is the test for a null array equivalent to a test for zero-length array?
This is particularly interesting for strings.
For instance, I could return an empty string from a toString-like
function
and the
Hi! I have a small question:
Is the test for a null array equivalent to a test for zero-length array?
This is particularly interesting for strings.
For instance, I could return an empty string from a toString-like function
and the empty string would be printed, but If I returned a null string,
that
48 matches
Mail list logo