On Tue, Jan 13, 2009 at 6:25 AM, Steven Schveighoffer
schvei...@yahoo.com wrote:
because that's basically what a foreach does when using opApply: create an
inner function and then pass a delegate pointing to that function to
opApply.
I think the difference between the two is that the
On Sun, 11 Jan 2009 20:31:51 +1300, Denis Koroskin 2kor...@gmail.com
wrote:
Yep that probibly is a slight bug. What I would like to know is why
cant I do foreach with primitive types like I can with objects.
You can use foreach to iterate over arrays and tuples, if that's what
you mean.
Why is this an error. Dmd wants to make sure that I declare a new variable
in the foreach statement and not use an existing one?
module test;
void main()
{
int i;
int[] nums;
foreach(i; nums)
{
//
}
}
dmd test.d
test.d(7): Error:
Tim M wrote:
Why is this an error. Dmd wants to make sure that I declare a new
variable in the foreach statement and not use an existing one?
module test;
void main()
{
int i;
int[] nums;
foreach(i; nums)
{
//
}
}
dmd test.d
test.d(7): Error: shadowing
On Sun, 11 Jan 2009 15:50:54 +1300, Daniel Keep
daniel.keep.li...@gmail.com wrote:
Tim M wrote:
Why is this an error. Dmd wants to make sure that I declare a new
variable in the foreach statement and not use an existing one?
module test;
void main()
{
int i;
int[] nums;
On Sun, 11 Jan 2009 15:59:26 +1300, Tim M a...@b.com wrote:
On Sun, 11 Jan 2009 15:50:54 +1300, Daniel Keep
daniel.keep.li...@gmail.com wrote:
Tim M wrote:
Why is this an error. Dmd wants to make sure that I declare a new
variable in the foreach statement and not use an existing one?
On Sun, Jan 11, 2009 at 12:04 PM, Tim M a...@b.com wrote:
On Sun, 11 Jan 2009 15:59:26 +1300, Tim M a...@b.com wrote:
Why does it still work for some objects?
This works:
module test;
class A
{
this()
{
//
}
}
class B
{
this()
On Sun, 11 Jan 2009 16:10:39 +1300, Bill Baxter wbax...@gmail.com wrote:
On Sun, Jan 11, 2009 at 12:04 PM, Tim M a...@b.com wrote:
On Sun, 11 Jan 2009 15:59:26 +1300, Tim M a...@b.com wrote:
Why does it still work for some objects?
This works:
module test;
class A
{
this()
On Sun, Jan 11, 2009 at 12:15 PM, Tim M a...@b.com wrote:
On Sun, 11 Jan 2009 16:10:39 +1300, Bill Baxter wbax...@gmail.com wrote:
On Sun, Jan 11, 2009 at 12:04 PM, Tim M a...@b.com wrote:
On Sun, 11 Jan 2009 15:59:26 +1300, Tim M a...@b.com wrote:
Why does it still work for some objects?
On Sun, 11 Jan 2009 06:04:01 +0300, Tim M a...@b.com wrote:
On Sun, 11 Jan 2009 15:59:26 +1300, Tim M a...@b.com wrote:
On Sun, 11 Jan 2009 15:50:54 +1300, Daniel Keep
daniel.keep.li...@gmail.com wrote:
Tim M wrote:
Why is this an error. Dmd wants to make sure that I declare a new
10 matches
Mail list logo