On Tue, Jan 13, 2009 at 6:25 AM, Steven Schveighoffer
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 compiler handles forea
"Denis Koroskin" wrote
> On Sun, 11 Jan 2009 06:04:01 +0300, Tim M wrote:
>
>> On Sun, 11 Jan 2009 15:59:26 +1300, Tim M wrote:
>>
>>> On Sun, 11 Jan 2009 15:50:54 +1300, Daniel Keep
>>> wrote:
>>>
Tim M wrote:
> Why is this an error. Dmd wants to make sure that I declare a
On Sun, 11 Jan 2009 21:39:55 +1300, Denis Koroskin <2kor...@gmail.com>
wrote:
On Sun, 11 Jan 2009 11:04:38 +0300, Tim M wrote:
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 fo
On Sun, 11 Jan 2009 11:04:38 +0300, Tim M wrote:
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 itera
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
On Sun, 11 Jan 2009 10:08:47 +0300, Tim M wrote:
On Sun, 11 Jan 2009 19:56:55 +1300, Denis Koroskin <2kor...@gmail.com>
wrote:
On Sun, 11 Jan 2009 06:04:01 +0300, Tim M wrote:
On Sun, 11 Jan 2009 15:59:26 +1300, Tim M wrote:
On Sun, 11 Jan 2009 15:50:54 +1300, Daniel Keep
wrote:
On Sun, 11 Jan 2009 19:56:55 +1300, Denis Koroskin <2kor...@gmail.com>
wrote:
On Sun, 11 Jan 2009 06:04:01 +0300, Tim M wrote:
On Sun, 11 Jan 2009 15:59:26 +1300, Tim M wrote:
On Sun, 11 Jan 2009 15:50:54 +1300, Daniel Keep
wrote:
Tim M wrote:
Why is this an error. Dmd wants to m
On Sun, 11 Jan 2009 06:04:01 +0300, Tim M wrote:
On Sun, 11 Jan 2009 15:59:26 +1300, Tim M wrote:
On Sun, 11 Jan 2009 15:50:54 +1300, Daniel Keep
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 e
On Sun, Jan 11, 2009 at 12:15 PM, Tim M wrote:
> On Sun, 11 Jan 2009 16:10:39 +1300, Bill Baxter wrote:
>
>> On Sun, Jan 11, 2009 at 12:04 PM, Tim M wrote:
>>>
>>> On Sun, 11 Jan 2009 15:59:26 +1300, Tim M wrote:
Why does it still work for some objects?
>>>
>>>
>>> This works:
>>>
>>>
On Sun, 11 Jan 2009 16:10:39 +1300, Bill Baxter wrote:
On Sun, Jan 11, 2009 at 12:04 PM, Tim M wrote:
On Sun, 11 Jan 2009 15:59:26 +1300, Tim M wrote:
Why does it still work for some objects?
This works:
module test;
class A
{
this()
{
//
}
}
class
On Sun, Jan 11, 2009 at 12:04 PM, Tim M wrote:
> On Sun, 11 Jan 2009 15:59:26 +1300, Tim M wrote:
>> Why does it still work for some objects?
>
>
> This works:
>
>
> module test;
>
> class A
> {
>this()
>{
>//
>}
> }
>
> class B
> {
>this()
>
On Sun, Jan 11, 2009 at 11:33 AM, 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)
>{
>
On Sun, 11 Jan 2009 15:59:26 +1300, Tim M wrote:
On Sun, 11 Jan 2009 15:50:54 +1300, Daniel Keep
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
On Sun, 11 Jan 2009 15:50:54 +1300, Daniel Keep
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;
foreach(i; nums)
{
On Sat, Jan 10, 2009 at 9:33 PM, 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?
You can't reuse existing variables as foreach loop indices, long story short.
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 declar
16 matches
Mail list logo