Re: How Performance down slow it is using UFCS friendly function?

2020-11-20 Thread Paul Backus via Digitalmars-d-learn
On Saturday, 21 November 2020 at 00:26:03 UTC, Marcone wrote: // Função receive() char[] receive(Socket socket, int size = 8192) nothrow { try { char[] buffer; buffer.length = size; int rq = socket.receive(buffer); return buf

How Performance down slow it is using UFCS friendly function?

2020-11-20 Thread Marcone via Digitalmars-d-learn
// Função receive() char[] receive(Socket socket, int size = 8192) nothrow { try { char[] buffer; buffer.length = size; int rq = socket.receive(buffer); return buffer[0..rq]; } catch(Throwable){return null;} } s = ne

Re: why is "hello".writeln considered bad?

2020-11-20 Thread norm via Digitalmars-d-learn
On Friday, 20 November 2020 at 18:46:40 UTC, Martin wrote: On Friday, 20 November 2020 at 10:03:18 UTC, Daniel Kozak wrote: I remember days when I liked UFCS too . Unfortunately it is not so awesome when you use it with IDE. And I would like to add: if you use in a bigger team. It's annoying

Re: Reflection on the book D web development.

2020-11-20 Thread CraigDillabaugh via Digitalmars-d-learn
On Friday, 20 November 2020 at 19:12:38 UTC, Alaindevos wrote: I bought the book "D Web Development". I understand only 20% of the book,the other 80% is way above my head. Compare, I own a book on flask development, and I understand 100% of it. Which means I can use dlang for anything except QT

Reflection on the book D web development.

2020-11-20 Thread Alaindevos via Digitalmars-d-learn
I bought the book "D Web Development". I understand only 20% of the book,the other 80% is way above my head. Compare, I own a book on flask development, and I understand 100% of it. Which means I can use dlang for anything except QT and serious web development ...

Re: why is "hello".writeln considered bad?

2020-11-20 Thread Martin via Digitalmars-d-learn
On Friday, 20 November 2020 at 10:03:18 UTC, Daniel Kozak wrote: I remember days when I liked UFCS too . Unfortunately it is not so awesome when you use it with IDE. And I would like to add: if you use in a bigger team. It's annoying when every dev have a own taste.. And together with option

Re: lambdas with types

2020-11-20 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 20 November 2020 at 15:07:09 UTC, H. S. Teoh wrote: Wouldn't it be just syntactic sugar for a manually-declared helper template? Yeah, there's just both alias and enum helper templates that can both be useful at times so you might have to use those keywords in there somewhere too.

Re: lambdas with types

2020-11-20 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Nov 20, 2020 at 02:52:41PM +, Adam D. Ruppe via Digitalmars-d-learn wrote: > On Friday, 20 November 2020 at 14:47:52 UTC, Paul Backus wrote: > > There is no way to create an anonymous template in D. > > I wish there was, maybe some day we can think of a way to add it to > the language

Re: lambdas with types

2020-11-20 Thread jmh530 via Digitalmars-d-learn
On Friday, 20 November 2020 at 14:57:42 UTC, H. S. Teoh wrote: On Fri, Nov 20, 2020 at 02:47:52PM +, Paul Backus via Digitalmars-d-learn wrote: [...] In this specific case, you could also make `foo` a type-safe variadic function [1], which would eliminate the need for `allSatisfy`: vo

Re: lambdas with types

2020-11-20 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Nov 20, 2020 at 02:47:52PM +, Paul Backus via Digitalmars-d-learn wrote: [...] > In this specific case, you could also make `foo` a type-safe variadic > function [1], which would eliminate the need for `allSatisfy`: > > void foo(double[] args...) > { > // ... > } [

Re: lambdas with types

2020-11-20 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 20 November 2020 at 14:47:52 UTC, Paul Backus wrote: There is no way to create an anonymous template in D. I wish there was, maybe some day we can think of a way to add it to the language.

Re: lambdas with types

2020-11-20 Thread Paul Backus via Digitalmars-d-learn
On Friday, 20 November 2020 at 14:08:23 UTC, jmh530 wrote: Doing something like below fails because I don't seem to be able to make a templated lambda that just takes types. Is the only way to do something similar to create a separate function to handle the condition, or is there some other way

Re: why is "hello".writeln considered bad?

2020-11-20 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Nov 20, 2020 at 11:03:18AM +0100, Daniel Kozak via Digitalmars-d-learn wrote: [...] >I remember days when I liked UFCS too . Unfortunately  it is not so >awesome when you use it with IDE. So I am now avoiding UFCS as much >as possible and it is a much better experience for me.

lambdas with types

2020-11-20 Thread jmh530 via Digitalmars-d-learn
Doing something like below fails because I don't seem to be able to make a templated lambda that just takes types. Is the only way to do something similar to create a separate function to handle the condition, or is there some other way to do something with similar flexibility? import std.std

Re: why is "hello".writeln considered bad?

2020-11-20 Thread Mike Parker via Digitalmars-d-learn
On Friday, 20 November 2020 at 10:03:18 UTC, Daniel Kozak wrote: I remember days when I liked UFCS too . Unfortunately it is not so awesome when you use it with IDE. So I am now avoiding UFCS as much as possible and it is a much better experience for me. Doesn't bother me. Auto-completion

Re: why is "hello".writeln considered bad?

2020-11-20 Thread Daniel Kozak via Digitalmars-d-learn
On Fri, Nov 20, 2020 at 8:55 AM Mike Parker via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: > ... > Eh, I wouldn't quite put it that way. If we're thinking of the > same thread, one person said he thought it was a bad idea. That > doesn't make it bad practice. It's just his opi

Re: why is "hello".writeln considered bad?

2020-11-20 Thread rikki cattermole via Digitalmars-d-learn
I was the person who wrote that example. It was just an example to show how it can be used. I would not write a function call like that when using a literal. As Mike said, its all up to personal preference.

Re: Calling function within class.

2020-11-20 Thread Arafel via Digitalmars-d-learn
On 19/11/20 20:51, Vino wrote: Hi Ali, Thank you very much, your solution works for my example, but it does not work for the main goal, let me explain what we are trying to perform. Nut shell: Try to execute an aws command on sever accounts in parallel to get some data. Noe: each account h