Jump to page: 1 217  
Page
Thread overview
DMD 0.170 release
Oct 17, 2006
Walter Bright
Oct 17, 2006
Walter Bright
Oct 17, 2006
Ary Manzana
Oct 17, 2006
Sean Kelly
Oct 17, 2006
John Reimer
Oct 17, 2006
Walter Bright
Oct 17, 2006
John Reimer
Oct 17, 2006
Walter Bright
Oct 18, 2006
Bill Baxter
Oct 18, 2006
Walter Bright
Oct 18, 2006
Bill Baxter
Oct 18, 2006
Oskar Linde
Oct 18, 2006
Bill Baxter
Oct 18, 2006
Oskar Linde
Oct 18, 2006
Bill Baxter
Oct 18, 2006
Walter Bright
Oct 18, 2006
Bill Baxter
Oct 18, 2006
Walter Bright
Oct 18, 2006
Ary Manzana
Oct 18, 2006
Bill Baxter
Oct 18, 2006
Sean Kelly
Oct 18, 2006
Walter Bright
foreach vs. iterators
Nov 03, 2006
Sean Kelly
Nov 03, 2006
Walter Bright
Nov 03, 2006
Sean Kelly
Nov 04, 2006
Georg Wrede
Nov 04, 2006
Walter Bright
Nov 04, 2006
Sean Kelly
Nov 05, 2006
Georg Wrede
Nov 04, 2006
Sean Kelly
Nov 03, 2006
Bill Baxter
Nov 03, 2006
Bill Baxter
Nov 04, 2006
Benji Smith
Nov 04, 2006
Bill Baxter
Nov 04, 2006
Kirk McDonald
Nov 04, 2006
Walter Bright
Nov 03, 2006
Oskar Linde
Nov 04, 2006
Bill Baxter
Nov 04, 2006
Walter Bright
Nov 04, 2006
Oskar Linde
Nov 04, 2006
Walter Bright
Nov 05, 2006
Sean Kelly
Nov 05, 2006
Sean Kelly
Nov 05, 2006
Bill Baxter
Nov 05, 2006
Bill Baxter
Nov 05, 2006
Sean Kelly
Nov 05, 2006
Sean Kelly
Nov 05, 2006
Bill Baxter
Nov 06, 2006
David Gileadi
Nov 06, 2006
BCS
Nov 06, 2006
Bill Baxter
Nov 07, 2006
BCS
Oct 18, 2006
Oskar Linde
Oct 18, 2006
Lars Ivar Igesund
Oct 18, 2006
Walter Bright
Oct 18, 2006
Sean Kelly
Oct 18, 2006
Walter Bright
Oct 18, 2006
Sean Kelly
Oct 19, 2006
Bruno Medeiros
Oct 19, 2006
Sean Kelly
Oct 23, 2006
Bruno Medeiros
Oct 24, 2006
Sean Kelly
Oct 26, 2006
Bruno Medeiros
Oct 29, 2006
Bruno Medeiros
Oct 29, 2006
Knud Sørensen
Oct 18, 2006
Bill Baxter
Oct 19, 2006
Walter Bright
Oct 17, 2006
Charles D Hixson
Oct 17, 2006
Vladimir Kulev
Oct 17, 2006
J Duncan
Oct 17, 2006
Vladimir Kulev
Oct 17, 2006
J Duncan
Oct 17, 2006
Lutger
Oct 17, 2006
Stewart Gordon
Oct 17, 2006
Walter Bright
Oct 18, 2006
BCS
Oct 18, 2006
Ivan Senji
Oct 18, 2006
Frits van Bommel
Oct 18, 2006
Ivan Senji
Oct 23, 2006
Stewart Gordon
Oct 17, 2006
Russ Lewis
Oct 17, 2006
BCS
Oct 17, 2006
Walter Bright
Oct 17, 2006
Walter Bright
Oct 17, 2006
Hasan Aljudy
Oct 17, 2006
Walter Bright
Oct 17, 2006
Frits van Bommel
Oct 17, 2006
Sean Kelly
Oct 18, 2006
BCS
Oct 17, 2006
Chris Miller
Oct 17, 2006
James Dunne
Oct 17, 2006
Lars Ivar Igesund
Oct 17, 2006
Kristian
Oct 17, 2006
Lars Ivar Igesund
Oct 17, 2006
Kristian
Oct 17, 2006
David Medlock
Oct 17, 2006
Walter Bright
Oct 17, 2006
Frits van Bommel
Oct 17, 2006
Walter Bright
Re: DMD 0.170 release (foreach_reverse)
Oct 26, 2006
Bill Baxter
Oct 26, 2006
John Reimer
Oct 26, 2006
Marcin Kuszczak
Oct 26, 2006
John Reimer
Oct 26, 2006
Bill Baxter
Oct 26, 2006
Mike Parker
Oct 26, 2006
Endea
Oct 26, 2006
Marcin Kuszczak
Oct 26, 2006
Bill Baxter
Oct 17, 2006
Serg Kovrov
Oct 17, 2006
Walter Bright
Oct 17, 2006
Tom S
Oct 17, 2006
Lars Ivar Igesund
Oct 17, 2006
Lars Ivar Igesund
Oct 17, 2006
Tom S
Great proposal! (was: Re: DMD 0.170 release)
Oct 17, 2006
Lars Ivar Igesund
Oct 17, 2006
Oskar Linde
Oct 18, 2006
Bill Baxter
Oct 18, 2006
Oskar Linde
Oct 17, 2006
Johan Granberg
Oct 17, 2006
Reiner Pope
Oct 17, 2006
Tom S
Oct 18, 2006
Reiner Pope
Oct 17, 2006
Walter Bright
Oct 18, 2006
Bruno Medeiros
Oct 17, 2006
Walter Bright
Oct 17, 2006
Bruno Medeiros
Oct 17, 2006
Lars Ivar Igesund
Oct 17, 2006
Kawa
Oct 17, 2006
Bill Baxter
Oct 17, 2006
Bill Baxter
Oct 18, 2006
Bill Baxter
Oct 18, 2006
Tom S
Oct 18, 2006
Bill Baxter
Oct 18, 2006
Tom S
Oct 18, 2006
Tom S
Oct 18, 2006
Bill Baxter
Oct 18, 2006
Tom S
Oct 18, 2006
Bill Baxter
Oct 18, 2006
Tom S
Oct 18, 2006
Bill Baxter
Oct 17, 2006
Ivan Senji
Oct 17, 2006
Walter Bright
Oct 17, 2006
Walter Bright
Oct 18, 2006
Bruno Medeiros
interface function isn't implemented - was Re: DMD 0.170 release
Oct 17, 2006
Chris Miller
Oct 17, 2006
Chris Miller
Oct 17, 2006
Walter Bright
Oct 17, 2006
Chris Miller
Oct 17, 2006
Lutger
Oct 18, 2006
Walter Bright
Oct 17, 2006
Walter Bright
Oct 20, 2006
Walter Bright
Re: DMD 0.170 release (website BUG)
Oct 23, 2006
Bruno Medeiros
Oct 23, 2006
Walter Bright
Oct 25, 2006
Bruno Medeiros
October 17, 2006
Added foreach_reverse, which addresses a serious shortcoming.

http://www.digitalmars.com/d/changelog.html
October 17, 2006
Walter Bright wrote:
> Added foreach_reverse, which addresses a serious shortcoming.
> 
> http://www.digitalmars.com/d/changelog.html


Lots of background for the foreach improvements in:

http://www.digitalmars.com/d/archives/digitalmars/D/17320.html
October 17, 2006
Walter Bright wrote:

> Added foreach_reverse, which addresses a serious shortcoming.
> 
> http://www.digitalmars.com/d/changelog.html

But foreach_reverse is such an ugly name, then I like 'reveach' (courtesy of
Mr Panek) much better :P

-- 
Lars Ivar Igesund
blog at http://larsivi.net
DSource & #D: larsivi
October 17, 2006
Hi Walter Bright, you wrote:
> Added foreach_reverse, which addresses a serious shortcoming.
> http://www.digitalmars.com/d/changelog.html

Thanks for great work, Walter!

Although could someone explain what exactly "null is now an exact match for null pointers, delegates, arrays, class objects, etc." changed?

thanks
-- 
serg.
October 17, 2006
Walter Bright schrieb:
> Added foreach_reverse, which addresses a serious shortcoming.
> 
> http://www.digitalmars.com/d/changelog.html

Thanks for the release and the bug fixes.

You can improve the change log with this:
- Add the heading of the bug report also to the changelog. So the
changelog is searchable for a specific change. And the reader does not
need to click through all bugs.
- Add a link to the doc of each language change.
October 17, 2006
On Tue, 17 Oct 2006 13:08:06 +0300, Lars Ivar Igesund <larsivar@igesund.net> wrote:

> Walter Bright wrote:
>
>> Added foreach_reverse, which addresses a serious shortcoming.
>>
>> http://www.digitalmars.com/d/changelog.html
>
> But foreach_reverse is such an ugly name, then I like 'reveach' (courtesy of
> Mr Panek) much better :P

'reveach' sounds good; I too think that 'foreach_reverse' is a bit awkward and lengthy.
October 17, 2006
Kristian wrote:

> On Tue, 17 Oct 2006 13:08:06 +0300, Lars Ivar Igesund <larsivar@igesund.net> wrote:
> 
>> Walter Bright wrote:
>>
>>> Added foreach_reverse, which addresses a serious shortcoming.
>>>
>>> http://www.digitalmars.com/d/changelog.html
>>
>> But foreach_reverse is such an ugly name, then I like 'reveach'
>> (courtesy of
>> Mr Panek) much better :P
> 
> 'reveach' sounds good; I too think that 'foreach_reverse' is a bit awkward and lengthy.

I'm not sure reveach is that good ;) I'd really like something else, though. 'rforeach' maybe?

-- 
Lars Ivar Igesund
blog at http://larsivi.net
DSource & #D: larsivi
October 17, 2006
Walter Bright wrote:
> Added foreach_reverse, which addresses a serious shortcoming.
> 
> http://www.digitalmars.com/d/changelog.html

Thanks for the new release :)

The foreach-on-delegate seems like a great feature, but in a somewhat harder to implement shape, it has been available for quite a while:

----

import std.stdio;


template opHackedApply(alias theImplFunc, IterType) {
	Iter entry() {
		Iter it; it.impl = &theImplFunc; return it;
	}
	struct Iter {
		int delegate(IterType) impl;
		int opApply(IterType dg) {
			return impl(dg);
		}
	}
}


class Foo {
	int oldIterImpl(int delegate(inout int) dg) {
		int a;
		a = 3; dg(a);
		a = 9; dg(a);
		return 0;
	}
	mixin opHackedApply!(oldIterImpl, int delegate(inout int)) oldIterMix;
	alias oldIterMix.entry oldIter;
}


void main() {
	Foo f = new Foo;

	foreach (i; f.oldIter) {
		writefln(i);
	}
}

----

Sure it doesn't look as nice, but at least it doesn't require the '&' token... But the point is that delegates don't have to be considered aggregates in order to implement this feature. Let's now assume that we have a few other features in D:

1. tuples
2. better metainfo for delegates and functions
3. hiding of private template members (so they dont interfere with automatic name promotion)
4. automatic name promotion of mixins:

template foo() {
	void foo() {}
}

struct Bar {
	mixin foo myFunc;
	void otherFunc() {
		myFunc();	// currently requires `myFunc.foo();`
	}
}


Then the hacked opApply can be used like:

----
template opHackedApply(alias theImplFunc) {
	Iter opHackedApply() {
		Iter it; it.impl = &theImplFunc; return it;
	}

	private alias theImplFunc.paramTypesTuple;
	private struct Iter {
		int delegate(IterType) impl;
		int opApply(IterType dg) {
			return impl(dg);
		}
	}
}

class Foo {
	int oldIterImpl(int delegate(inout int) dg) {
		int a;
		a = 3; dg(a);
		a = 9; dg(a);
		return 0;
	}
	mixin opHackedApply!(oldIterImpl) oldIter;
}
----

It's not as short as the treatment-of-delegates-as-aggregates but it only uses builtin features. Yeah, builtin features of my dreamed D version, but all the required features have been proposed before and would make the whole language better (IMHO, but I'm sure more people would agree with me here). On the other side, allowing iteration on delegates only because they match a required signature doesn't make the language simpler at all.


--
Tomasz Stachowiak
October 17, 2006
Walter, you always say that new features shouldn't be added if they fairly easily can be done with existing language constructs. Now, the post below is about possible new features in D (of general interest and with many possible applications), and it is shown how they can be used to implement an existing (and specific) feature in D. I'm not sure if this should be used as an argument for removing the new delegate-as-aggregate feature, but it certainly shows that the proposed features have merit.


Tom S wrote:

> Walter Bright wrote:
>> Added foreach_reverse, which addresses a serious shortcoming.
>> 
>> http://www.digitalmars.com/d/changelog.html
> 
> Thanks for the new release :)
> 
> The foreach-on-delegate seems like a great feature, but in a somewhat harder to implement shape, it has been available for quite a while:
> 
> ----
> 
> import std.stdio;
> 
> 
> template opHackedApply(alias theImplFunc, IterType) {
> Iter entry() {
> Iter it; it.impl = &theImplFunc; return it;
> }
> struct Iter {
> int delegate(IterType) impl;
> int opApply(IterType dg) {
> return impl(dg);
> }
> }
> }
> 
> 
> class Foo {
> int oldIterImpl(int delegate(inout int) dg) {
> int a;
> a = 3; dg(a);
> a = 9; dg(a);
> return 0;
> }
> mixin opHackedApply!(oldIterImpl, int delegate(inout int)) oldIterMix;
> alias oldIterMix.entry oldIter;
> }
> 
> 
> void main() {
> Foo f = new Foo;
> 
> foreach (i; f.oldIter) {
> writefln(i);
> }
> }
> 
> ----
> 
> Sure it doesn't look as nice, but at least it doesn't require the '&' token... But the point is that delegates don't have to be considered aggregates in order to implement this feature. Let's now assume that we have a few other features in D:
> 
> 1. tuples
> 2. better metainfo for delegates and functions
> 3. hiding of private template members (so they dont interfere with
> automatic name promotion)
> 4. automatic name promotion of mixins:
> 
> template foo() {
> void foo() {}
> }
> 
> struct Bar {
> mixin foo myFunc;
> void otherFunc() {
> myFunc();     // currently requires `myFunc.foo();`
> }
> }
> 
> 
> Then the hacked opApply can be used like:
> 
> ----
> template opHackedApply(alias theImplFunc) {
> Iter opHackedApply() {
> Iter it; it.impl = &theImplFunc; return it;
> }
> 
> private alias theImplFunc.paramTypesTuple;
> private struct Iter {
> int delegate(IterType) impl;
> int opApply(IterType dg) {
> return impl(dg);
> }
> }
> }
> 
> class Foo {
> int oldIterImpl(int delegate(inout int) dg) {
> int a;
> a = 3; dg(a);
> a = 9; dg(a);
> return 0;
> }
> mixin opHackedApply!(oldIterImpl) oldIter;
> }
> ----
> 
> It's not as short as the treatment-of-delegates-as-aggregates but it only uses builtin features. Yeah, builtin features of my dreamed D version, but all the required features have been proposed before and would make the whole language better (IMHO, but I'm sure more people would agree with me here). On the other side, allowing iteration on delegates only because they match a required signature doesn't make the language simpler at all.
> 
> 
> --
> Tomasz Stachowiak

-- 
Lars Ivar Igesund
blog at http://larsivi.net
DSource & #D: larsivi
October 17, 2006
Walter Bright wrote:
> Added foreach_reverse, which addresses a serious shortcoming.
> 
> http://www.digitalmars.com/d/changelog.html

foreach_reverse addresses a serious shortcoming? What is that, if instead of:
  foreach_reverse(Foo f; aggregate) { ...
I can do:
  foreach(Foo f; &aggregate.opApplyReverse) { ...

The latter form is both more general (allows any kind of iterators) and more simple/orthogonal (no extra special statements are needed).

-- 
Bruno Medeiros - MSc in CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
« First   ‹ Prev
1 2 3 4 5 6 7 8 9 10 11