Steven Schveighoffer wrote:
> In fact, it does work, in D1 no less.
thx
... and another example, that initializing with int.max would serve
Walter's intentions better.
-manfred
On Mon, 31 Aug 2009 14:55:43 -0400, Steven Schveighoffer
wrote:
It's possible that something like what you wrote could work (although
I'd write it foo(ref int i = j)).
In fact, it does work, in D1 no less.
# cat testme.d
import tango.io.Stdout;
int j;
void foo(ref int i = j)
{
i++;
On Mon, 31 Aug 2009 13:00:34 -0400, Manfred_Nowak
wrote:
Steven Schveighoffer wrote:
What is i referencing when you call:
foo();
Is this an argument for making
int j;
void foo(ref int i = &j);
foo():
legal D?
No, I'm just trying to explain why having a default value for a ref
Steven Schveighoffer wrote:
> What is i referencing when you call:
> foo();
Is this an argument for making
int j;
void foo(ref int i = &j);
foo():
legal D?
-manfred
On Sun, 30 Aug 2009 11:25:59 -0400, Ellery Newcomer
wrote:
Steven Schveighoffer wrote:
On Sat, 29 Aug 2009 20:15:55 -0400, Ellery Newcomer
wrote:
void blah(out bool a = false){
// blah blah blah
}
compile time use of blah results in error.
Am I doing anything wrong?
out implies a ref
Rainer Deyke wrote:
Jarrett Billingsley wrote:
"Members are always initialized to the default initializer for their
type, which is usually 0 for integer types and NAN for floating point
types. This eliminates an entire class of obscure problems that come
from neglecting to initialize a member i
Jarrett Billingsley wrote:
> "Members are always initialized to the default initializer for their
> type, which is usually 0 for integer types and NAN for floating point
> types. This eliminates an entire class of obscure problems that come
> from neglecting to initialize a member in one of the co
Jarrett Billingsley wrote:
> On Sun, Aug 30, 2009 at 3:02 PM, Rainer Deyke wrote:
>> The purpose of default initialization is not to find or reduce bugs, but
>> to reduce the size of legal programs.
>
> I'm wondering where the heck you got that justification.
By looking at the actual effect of de
On Sun, Aug 30, 2009 at 3:14 PM, Jarrett
Billingsley wrote:
> On Sun, Aug 30, 2009 at 3:02 PM, Rainer Deyke wrote:
>> The purpose of default initialization is not to find or reduce bugs, but
>> to reduce the size of legal programs.
>
> I'm wondering where the heck you got that justification.
Also,
On Sun, Aug 30, 2009 at 3:02 PM, Rainer Deyke wrote:
> The purpose of default initialization is not to find or reduce bugs, but
> to reduce the size of legal programs.
I'm wondering where the heck you got that justification.
Jarrett Billingsley wrote:
> "It is an error to use a local variable without first assigning it a
> value. The implementation may not always be able to detect these
> cases. Other language compilers sometimes issue a warning for this,
> but since it is always a bug, it should be an error."
> http:/
Steven Schveighoffer wrote:
> On Sat, 29 Aug 2009 20:15:55 -0400, Ellery Newcomer
> wrote:
>
>> void blah(out bool a = false){
>> // blah blah blah
>> }
>>
>> compile time use of blah results in error.
>>
>> Am I doing anything wrong?
>
> out implies a reference. You can't have a reference to
I wouldn't be surprised if W himself has forgotten about this rule,
since other parts of the spec make no mention of it, or seem to depend
on the default-initialization of variables.
"If the Initializer is void, however, the variable is not initialized.
If its value is used before it is set, unde
On Sun, Aug 30, 2009 at 7:13 AM, grauzone wrote:
>> Although teeechnically speaking that would be illegal code. The D
>> spec says that it's not legal to use the value of uninitialized
>> variables. Default initialization is kind of a poor man's substitute
>> for actual flow control which deter
On Sun, Aug 30, 2009 at 5:34 AM, Rainer Deyke wrote:
> Jarrett Billingsley wrote:
>> Although teeechnically speaking that would be illegal code. The D
>> spec says that it's not legal to use the value of uninitialized
>> variables. Default initialization is kind of a poor man's substitute
>> fo
Jarrett Billingsley wrote:
On Sun, Aug 30, 2009 at 12:24 AM, Ary Borenszweig wrote:
Steven Schveighoffer escribió:
On Sat, 29 Aug 2009 20:15:55 -0400, Ellery Newcomer
wrote:
void blah(out bool a = false){
// blah blah blah
}
compile time use of blah results in error.
Am I doing anything w
Jarrett Billingsley wrote:
> Although teeechnically speaking that would be illegal code. The D
> spec says that it's not legal to use the value of uninitialized
> variables. Default initialization is kind of a poor man's substitute
> for actual flow control which determines that. By relying on
On Sun, Aug 30, 2009 at 12:24 AM, Ary Borenszweig wrote:
> Steven Schveighoffer escribió:
>>
>> On Sat, 29 Aug 2009 20:15:55 -0400, Ellery Newcomer
>> wrote:
>>
>>> void blah(out bool a = false){
>>> // blah blah blah
>>> }
>>>
>>> compile time use of blah results in error.
>>>
>>> Am I doing any
Steven Schveighoffer escribió:
On Sat, 29 Aug 2009 20:15:55 -0400, Ellery Newcomer
wrote:
void blah(out bool a = false){
// blah blah blah
}
compile time use of blah results in error.
Am I doing anything wrong?
out implies a reference. You can't have a reference to a manifest
constant
On Sat, 29 Aug 2009 20:15:55 -0400, Ellery Newcomer
wrote:
void blah(out bool a = false){
// blah blah blah
}
compile time use of blah results in error.
Am I doing anything wrong?
out implies a reference. You can't have a reference to a manifest
constant like that.
If you want to en
void blah(out bool a = false){
// blah blah blah
}
compile time use of blah results in error.
Am I doing anything wrong?
21 matches
Mail list logo