Re: D vs Rust: function signatures

2014-04-30 Thread Timon Gehr via Digitalmars-d
On 04/30/2014 04:04 AM, Vladimir Panteleev wrote: fn map<'r, B>(self, f: |A|: 'r -> B) -> Map<'r, A, B, Self> Same as points 1 and 3 above (D's version allows specifying multiple functions). Not sure what 'r or |A| means in Rust syntax, but I guess this would be the equivalent D syntax: auto

Re: D vs Rust: function signatures

2014-04-30 Thread Nick Sabalausky via Digitalmars-d
On 4/30/2014 3:26 AM, Paulo Pinto wrote: On Wednesday, 30 April 2014 at 01:49:01 UTC, Nick Sabalausky wrote: On 4/29/2014 9:38 PM, Narrator wrote: fn map<'r, B>(self, f: |A|: 'r -> B) -> Map<'r, A, B, Self> That looks like line noise. Not if one is used to ML languages. Beauty is in the e

Re: D vs Rust: function signatures

2014-04-30 Thread bearophile via Digitalmars-d
Nick Sabalausky: On 4/29/2014 9:38 PM, Narrator wrote: fn map<'r, B>(self, f: |A|: 'r -> B) -> Map<'r, A, B, Self> That looks like line noise. In D there is a lambda syntax: auto F = (in int x) => x ^^ 2; void main() { int y; auto G = (in int x) => x + y; pragma(msg, typeof(F)

Re: D vs Rust: function signatures

2014-04-30 Thread John Colvin via Digitalmars-d
On Wednesday, 30 April 2014 at 01:38:46 UTC, Narrator wrote: The unbelievable amount of time and energy that's been spent discussing the smallest syntax, you would think that D would, at the very least, have better looking function signatures, but it doesn't. auto zip(Ranges...)(Ranges ranges

Re: D vs Rust: function signatures

2014-04-30 Thread Paulo Pinto via Digitalmars-d
On Wednesday, 30 April 2014 at 01:49:01 UTC, Nick Sabalausky wrote: On 4/29/2014 9:38 PM, Narrator wrote: fn map<'r, B>(self, f: |A|: 'r -> B) -> Map<'r, A, B, Self> That looks like line noise. Not if one is used to ML languages. Beauty is in the eyes of the beholder. :)

Re: D vs Rust: function signatures

2014-04-29 Thread Vladimir Panteleev via Digitalmars-d
On Wednesday, 30 April 2014 at 01:38:46 UTC, Narrator wrote: The unbelievable amount of time and energy that's been spent discussing the smallest syntax, you would think that D would, at the very least, have better looking function signatures, but it doesn't. auto zip(Ranges...)(Ranges ranges

Re: D vs Rust: function signatures

2014-04-29 Thread Nick Sabalausky via Digitalmars-d
On 4/29/2014 9:38 PM, Narrator wrote: fn map<'r, B>(self, f: |A|: 'r -> B) -> Map<'r, A, B, Self> That looks like line noise.

D vs Rust: function signatures

2014-04-29 Thread Narrator via Digitalmars-d
The unbelievable amount of time and energy that's been spent discussing the smallest syntax, you would think that D would, at the very least, have better looking function signatures, but it doesn't. auto zip(Ranges...)(Ranges ranges) if (Ranges.length && allSatisfy!(isInputRange, Ranges)); au