Re: Custom Blocks

2010-08-13 Thread Robert Jacques
On Thu, 12 Aug 2010 14:56:54 -0400, KennyTM~ kenn...@gmail.com wrote: On Aug 12, 10 23:42, Robert Jacques wrote: On Thu, 12 Aug 2010 07:43:25 -0400, KennyTM~ kenn...@gmail.com wrote: On Aug 12, 10 10:25, Robert Jacques wrote: On Wed, 11 Aug 2010 17:54:35 -0400, Tomek Sowiński j...@ask.me

Re: Custom Blocks

2010-08-12 Thread KennyTM~
On Aug 12, 10 10:25, Robert Jacques wrote: On Wed, 11 Aug 2010 17:54:35 -0400, Tomek Sowiński j...@ask.me wrote: Robert Jacques napisał: I was thinking something like this: void fun(int x, int y, int z, delegate void(int, int, int) dg) fun(x, y, z, a, b, c) { body } | V fun(x, y, z, (a,

Re: Custom Blocks

2010-08-12 Thread Robert Jacques
On Thu, 12 Aug 2010 07:43:25 -0400, KennyTM~ kenn...@gmail.com wrote: On Aug 12, 10 10:25, Robert Jacques wrote: On Wed, 11 Aug 2010 17:54:35 -0400, Tomek Sowiński j...@ask.me wrote: Robert Jacques napisał: I was thinking something like this: void fun(int x, int y, int z, delegate

Re: Custom Blocks

2010-08-12 Thread KennyTM~
On Aug 12, 10 23:42, Robert Jacques wrote: On Thu, 12 Aug 2010 07:43:25 -0400, KennyTM~ kenn...@gmail.com wrote: On Aug 12, 10 10:25, Robert Jacques wrote: On Wed, 11 Aug 2010 17:54:35 -0400, Tomek Sowiński j...@ask.me wrote: Robert Jacques napisał: I was thinking something like this:

Re: Custom Blocks

2010-08-12 Thread KennyTM~
On Aug 13, 10 02:56, KennyTM~ wrote: On Aug 12, 10 23:42, Robert Jacques wrote: On Thu, 12 Aug 2010 07:43:25 -0400, KennyTM~ kenn...@gmail.com wrote: On Aug 12, 10 10:25, Robert Jacques wrote: On Wed, 11 Aug 2010 17:54:35 -0400, Tomek Sowiński j...@ask.me wrote: Robert Jacques napisał: I

Re: Custom Blocks

2010-08-11 Thread Tomek Sowiński
Robert Jacques napisał: I was thinking something like this: void fun(int x, int y, int z, delegate void(int, int, int) dg) fun(x, y, z, a, b, c) { body } | V fun(x, y, z, (a, b, c) { body }); Mixing function args with delegate args makes me think of foreach: fun(x, y, z, (a, b, c) {

Re: Custom Blocks

2010-08-11 Thread Robert Jacques
On Wed, 11 Aug 2010 17:54:35 -0400, Tomek Sowiński j...@ask.me wrote: Robert Jacques napisał: I was thinking something like this: void fun(int x, int y, int z, delegate void(int, int, int) dg) fun(x, y, z, a, b, c) { body } | V fun(x, y, z, (a, b, c) { body }); Mixing function args with

Re: Custom Blocks

2010-08-10 Thread Jacob Carlborg
On 2010-08-10 05:21, Andrei Alexandrescu wrote: Chris Williams wrote: I'm not sure whether the design of D 2.0 has stabilized as yet, but if not, I would like to suggest the ability to create custom block types. [snip] FWIW we've been talking a long time ago about a simple lowering - if the

Re: Custom Blocks

2010-08-10 Thread Mafi
Am 10.08.2010 05:21, schrieb Andrei Alexandrescu: Chris Williams wrote: I'm not sure whether the design of D 2.0 has stabilized as yet, but if not, I would like to suggest the ability to create custom block types. [snip] FWIW we've been talking a long time ago about a simple lowering - if the

Re: Custom Blocks

2010-08-10 Thread Lutger
Andrei Alexandrescu wrote: Chris Williams wrote: I'm not sure whether the design of D 2.0 has stabilized as yet, but if not, I would like to suggest the ability to create custom block types. [snip] FWIW we've been talking a long time ago about a simple lowering - if the last argument to a

Re: Custom Blocks

2010-08-10 Thread Jason House
vote++ It's worth an @keyword if it keeps things simple for both users and the compiler. Andrei Alexandrescu Wrote: Chris Williams wrote: I'm not sure whether the design of D 2.0 has stabilized as yet, but if not, I would like to suggest the ability to create custom block types. [snip]

Re: Custom Blocks

2010-08-10 Thread Chris Williams
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article FWIW we've been talking a long time ago about a simple lowering - if the last argument to a function is a delegate, allow moving the delegate's body outside of the function: fun(a, b, c) { body } | V fun((a, b,

Re: Custom Blocks

2010-08-10 Thread aarti_pl
W dniu 2010-08-10 05:21, Andrei Alexandrescu pisze: Chris Williams wrote: I'm not sure whether the design of D 2.0 has stabilized as yet, but if not, I would like to suggest the ability to create custom block types. [snip] FWIW we've been talking a long time ago about a simple lowering - if

Re: Custom Blocks

2010-08-10 Thread Stanislav Blinov
10.08.2010 9:19, Kagamin пишет: Andrei Alexandrescu Wrote: FWIW we've been talking a long time ago about a simple lowering - if the last argument to a function is a delegate, allow moving the delegate's body outside of the function: fun(a, b, c) { body } | V fun((a, b, c) { body });

Re: Custom Blocks

2010-08-10 Thread Chris Williams
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article FWIW we've been talking a long time ago about a simple lowering - if the last argument to a function is a delegate, allow moving the delegate's body outside of the function: fun(a, b, c) { body } | V fun((a, b,

Re: Custom Blocks

2010-08-10 Thread Lutger
Chris Williams wrote: ... That brings us to the second problem. Our last parameter for a custom block is always void delegate() and our return is always void. There's nothing to be gained by forcing the coder to write both. ruby blocks have a special syntax for block parameters and foreach

Re: Custom Blocks

2010-08-10 Thread Nick Sabalausky
blocks are void, but I'm not sure that limitation should be preserved for custom blocks. Example: auto result = collection.reduce(a, b) { return a + b; };

Re: Custom Blocks

2010-08-10 Thread cemiller
On Mon, 09 Aug 2010 20:21:25 -0700, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Chris Williams wrote: I'm not sure whether the design of D 2.0 has stabilized as yet, but if not, I would like to suggest the ability to create custom block types. [snip] FWIW we've been talking

Re: Custom Blocks

2010-08-10 Thread Nick Sabalausky
cemiller ch...@dprogramming.com wrote in message news:op.vg8kr7h9ycw...@mapddrule1.ffe.foxeg.com... On Mon, 09 Aug 2010 20:21:25 -0700, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: fun(a, b, c) { body } | V fun((a, b, c) { body }); I think this way will be better:

Re: Custom Blocks

2010-08-10 Thread Robert Jacques
On Tue, 10 Aug 2010 15:19:25 -0400, Nick Sabalausky a...@a.a wrote: cemiller ch...@dprogramming.com wrote in message news:op.vg8kr7h9ycw...@mapddrule1.ffe.foxeg.com... On Mon, 09 Aug 2010 20:21:25 -0700, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: fun(a, b, c) { body } | V

Custom Blocks

2010-08-09 Thread Chris Williams
I'm not sure whether the design of D 2.0 has stabilized as yet, but if not, I would like to suggest the ability to create custom block types. For example, say that I have an object that I'm using in a multithreaded application. In general, I would do something like: synchronized (myObject) {

Re: Custom Blocks

2010-08-09 Thread Andrei Alexandrescu
Chris Williams wrote: I'm not sure whether the design of D 2.0 has stabilized as yet, but if not, I would like to suggest the ability to create custom block types. [snip] FWIW we've been talking a long time ago about a simple lowering - if the last argument to a function is a delegate, allow

Re: Custom Blocks

2010-08-09 Thread Robert Jacques
On Mon, 09 Aug 2010 23:21:25 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Chris Williams wrote: I'm not sure whether the design of D 2.0 has stabilized as yet, but if not, I would like to suggest the ability to create custom block types. [snip] FWIW we've been talking

Re: Custom Blocks

2010-08-09 Thread dsimcha
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article Chris Williams wrote: I'm not sure whether the design of D 2.0 has stabilized as yet, but if not, I would like to suggest the ability to create custom block types. [snip] FWIW we've been talking a long time ago

Re: Custom Blocks

2010-08-09 Thread Kagamin
Andrei Alexandrescu Wrote: FWIW we've been talking a long time ago about a simple lowering - if the last argument to a function is a delegate, allow moving the delegate's body outside of the function: fun(a, b, c) { body } | V fun((a, b, c) { body }); I don't think, doOnce