On Tue, 05 Apr 2011 18:46:06 +0100, Steven Schveighoffer
schvei...@yahoo.com wrote:
On Tue, 05 Apr 2011 13:24:49 -0400, Regan Heath re...@netmail.co.nz
wrote:
On Fri, 01 Apr 2011 18:23:28 +0100, Steven Schveighoffer
schvei...@yahoo.com wrote:
assert( !is null); // works on D. Try it.
bearophile Wrote:
Regan Heath:
conceptually it's nice to be able to express (exists but is empty) and
(does not exist).
You may want to express that, but for the implementation of the language
those two situations are the same, because in the [] literal the ptr is null.
So I think
On Mon, 28 Mar 2011 17:54:29 +0100, bearophile bearophileh...@lycps.com
wrote:
Steven Schveighoffer:
So essentially, you are getting the same thing, but using [] is slower.
It seems I was right then, thank you and Kagamin for the answers.
This may be slightly OT but I just wanted to raise
Regan Heath:
conceptually it's nice to be able to express (exists but is empty) and
(does not exist).
You may want to express that, but for the implementation of the language those
two situations are the same, because in the [] literal the ptr is null. So I
think it's better for the
2011/4/1 Regan Heath re...@netmail.co.nz:
On Mon, 28 Mar 2011 17:54:29 +0100, bearophile bearophileh...@lycps.com
wrote:
Steven Schveighoffer:
So essentially, you are getting the same thing, but using [] is slower.
It seems I was right then, thank you and Kagamin for the answers.
This
On 04/01/2011 12:38 PM, Regan Heath wrote:
On Mon, 28 Mar 2011 17:54:29 +0100, bearophile bearophileh...@lycps.com wrote:
Steven Schveighoffer:
So essentially, you are getting the same thing, but using [] is slower.
It seems I was right then, thank you and Kagamin for the answers.
This
On Fri, 01 Apr 2011 06:38:56 -0400, Regan Heath re...@netmail.co.nz
wrote:
On Mon, 28 Mar 2011 17:54:29 +0100, bearophile
bearophileh...@lycps.com wrote:
Steven Schveighoffer:
So essentially, you are getting the same thing, but using [] is slower.
It seems I was right then, thank you
On Fri, 01 Apr 2011 13:38:45 +0100, Steven Schveighoffer
schvei...@yahoo.com wrote:
On Fri, 01 Apr 2011 06:38:56 -0400, Regan Heath re...@netmail.co.nz
wrote:
On Mon, 28 Mar 2011 17:54:29 +0100, bearophile
bearophileh...@lycps.com wrote:
Steven Schveighoffer:
So essentially, you are
On Fri, 01 Apr 2011 11:52:47 -0400, Regan Heath re...@netmail.co.nz
wrote:
On Fri, 01 Apr 2011 13:38:45 +0100, Steven Schveighoffer
schvei...@yahoo.com wrote:
On Fri, 01 Apr 2011 06:38:56 -0400, Regan Heath re...@netmail.co.nz
wrote:
On Mon, 28 Mar 2011 17:54:29 +0100, bearophile
bearophile Wrote:
Kagamin:
[] is not null, it's an array of 0 elements, what is done exactly.
edx points to the allocated array.
I don't understand what you say. I think the caller of foo() and bar()
receive the same thing, two empty registers. I think that cast(int[])null and
On Sun, 27 Mar 2011 09:37:47 -0400, bearophile bearophileh...@lycos.com
wrote:
I have compiled this little D2 program:
int[] foo() {
return [];
}
int[] bar() {
return null;
}
void main() {}
Using DMD 2.052, dmd -O -release -inline test2.d
This is the asm of the two functions:
Steven Schveighoffer:
So essentially, you are getting the same thing, but using [] is slower.
It seems I was right then, thank you and Kagamin for the answers.
Bye,
bearophile
I have compiled this little D2 program:
int[] foo() {
return [];
}
int[] bar() {
return null;
}
void main() {}
Using DMD 2.052, dmd -O -release -inline test2.d
This is the asm of the two functions:
_D5test23fooFZAicomdat
L0: pushEAX
mov EAX,offset
bearophile Wrote:
I have compiled this little D2 program:
int[] foo() {
return [];
}
int[] bar() {
return null;
}
void main() {}
Using DMD 2.052, dmd -O -release -inline test2.d
This is the asm of the two functions:
_D5test23fooFZAicomdat
L0: pushEAX
Kagamin:
[] is not null, it's an array of 0 elements, what is done exactly.
edx points to the allocated array.
I don't understand what you say. I think the caller of foo() and bar() receive
the same thing, two empty registers. I think that cast(int[])null and
cast(int[])[] are the same thing
On 2011-03-27 11:42, bearophile wrote:
Kagamin:
[] is not null, it's an array of 0 elements, what is done exactly.
edx points to the allocated array.
I don't understand what you say. I think the caller of foo() and bar()
receive the same thing, two empty registers. I think that
Jonathan M Davis:
the compiler can likely make
assumptions about null that it can't make about [], since it probably treats
[] more generally without worrying about the fact that it happens to be empty
as far as optimizations go - that and there _is_ a semantic difference
between
null
17 matches
Mail list logo