Re: Article: the feature that makes D my favorite programming language
On Saturday, 25 July 2020 at 18:24:22 UTC, Jesse Phillips wrote: On Saturday, 25 July 2020 at 14:47:01 UTC, aberba wrote: On Saturday, 25 July 2020 at 13:28:34 UTC, Adam D. Ruppe wrote: On Saturday, 25 July 2020 at 11:12:16 UTC, aberba wrote: Oop! Chaining the writeln too could have increased the wow factor. I didn't see that. oh I hate it when people do that though, it just looks off to me at that point. Ha ha. If you're writing idiomatic D code, why not not all in on it? It bugs me too, though I have done it. I think the right answer of why it is odd is because writeln is void. As soon as it is placed on the end the chain is broken and you can't expand on it. This is no different from any other "sink" that consumes a range: someSource .map!foo .filter!bar .splitter(baz) .each!quux; `each` returns void [1], so using it ends the chain. But that's not a problem, because the whole *point* of using `each` is to consume the range. [1] Not exactly, but close enough.
Re: Article: the feature that makes D my favorite programming language
On 7/25/20 7:47 AM, aberba wrote: > On Saturday, 25 July 2020 at 13:28:34 UTC, Adam D. Ruppe wrote: >> oh I hate it when people do that though, it just looks off to me at >> that point. > > Ha ha. If you're writing idiomatic D code, why not not all in on it? I agree with Adam and others on this. My reasoning is, writeln's first parameter is not special compared to its other parameters. In other words, I can't see writeln as a special operation on its first argument. Except, when there is just one thing... Meh... I don't like it. :) Ali
Re: Article: the feature that makes D my favorite programming language
On Saturday, 25 July 2020 at 14:47:01 UTC, aberba wrote: On Saturday, 25 July 2020 at 13:28:34 UTC, Adam D. Ruppe wrote: On Saturday, 25 July 2020 at 11:12:16 UTC, aberba wrote: Oop! Chaining the writeln too could have increased the wow factor. I didn't see that. oh I hate it when people do that though, it just looks off to me at that point. Ha ha. If you're writing idiomatic D code, why not not all in on it? It bugs me too, though I have done it. I think the right answer of why it is odd is because writeln is void. As soon as it is placed on the end the chain is broken and you can't expand on it.
Re: Article: the feature that makes D my favorite programming language
On Sat, Jul 25, 2020 at 01:28:34PM +, Adam D. Ruppe via Digitalmars-d-announce wrote: > On Saturday, 25 July 2020 at 11:12:16 UTC, aberba wrote: > > Oop! Chaining the writeln too could have increased the wow factor. I > > didn't see that. > > oh I hate it when people do that though, it just looks off to me at > that point. Me too. It gives me the same creepie-feelies as when people write writeln(x) as: writeln = x; Actually, D's lax syntax surrounding the = operator gives rise to the following reverse-UFCS nastiness: // Cover your eyes (unless you're reverse-Polish :-P)! and don't // do this at home, it will corrupt your sense of good coding // style! import std; void main() { writeln = filter!(x => x % 3 == 1) = map!(x => x*2) = [ 1, 2, 3, 4, 5, 6 ]; } // Output: [4, 10] T -- Winners never quit, quitters never win. But those who never quit AND never win are idiots.
Re: Beerconf July 2020
On Saturday, 25 July 2020 at 15:27:33 UTC, Iain Buclaw wrote: On Friday, 10 July 2020 at 19:56:46 UTC, Steven Schveighoffer wrote: For more information about beerconf, see https://dlang.org/blog/2017/04/19/the-dconf-experience/ and all the other posts about dconf. Hi Everyone, I've started up a meeting for people to come and go as they please. https://meet.jit.si/Dlang2020JulyBeerConf password: __traits(isLazy) I hope to join in a couple hours. Just a friendly reminder, it would be good if you give yourself a display name before clicking "Join Meeting" (you can do so in the text box just above the join button). Lurkers are welcome, of course. It would be kinder to lets others know you are more than just a Fellow Jitsier.
Re: Beerconf July 2020
On Friday, 10 July 2020 at 19:56:46 UTC, Steven Schveighoffer wrote: For more information about beerconf, see https://dlang.org/blog/2017/04/19/the-dconf-experience/ and all the other posts about dconf. Hi Everyone, I've started up a meeting for people to come and go as they please. https://meet.jit.si/Dlang2020JulyBeerConf password: __traits(isLazy) I hope to join in a couple hours. Iain
DIP 1029--Add throw as Function Attribute--Formal Assessment
Now that our new DIP rules have been announced, I'm going to get the DIP process moving again. And the first thing on the list is the announcement that DIP 1029, "Add throw as Function Attribute" has been accepted. https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1029.md The rationale is in the DIP's Review Summary, but I quote it here for convenience: "This DIP was accepted with no request for revision. The Language Maintainers felt that arguments suggesting alternative syntax, such as @throw or throw!bool, are not persuasive. The motivation behind @ in attribute names is to provide an alternative to the introduction of new keywords. However, throw is already a keyword, and adding @throw would introduce an incongruity with nothrow. Leaving them both as-is is the simplest approach. throw!bool would render nothrow redundant and is inconsistent with the existing set of built-in attributes. Also, there were no strong objections to the proposal itself. Although some objections were raised to the introduction of a counter to nothrow alone as opposed to a broader proposal encompassing all similar attributes, the Language Maintainers see no problem. This DIP is focused solely on the obvious application of the existing throw keyword to its new role. Any larger changes to attribute syntax are beyond its scope."
Re: Article: the feature that makes D my favorite programming language
On Saturday, 25 July 2020 at 13:28:34 UTC, Adam D. Ruppe wrote: On Saturday, 25 July 2020 at 11:12:16 UTC, aberba wrote: Oop! Chaining the writeln too could have increased the wow factor. I didn't see that. oh I hate it when people do that though, it just looks off to me at that point. Ha ha. If you're writing idiomatic D code, why not not all in on it?
Re: Article: the feature that makes D my favorite programming language
On Saturday, 25 July 2020 at 11:12:16 UTC, aberba wrote: Oop! Chaining the writeln too could have increased the wow factor. I didn't see that. oh I hate it when people do that though, it just looks off to me at that point.
Re: Article: the feature that makes D my favorite programming language
On Saturday, 25 July 2020 at 10:22:53 UTC, Andre Pany wrote: On Friday, 24 July 2020 at 20:34:17 UTC, aberba wrote: Wrote something on the feature that makes D my favorite programming language https://opensource.com/article/20/7/d-programming Great article. I assume you didn't chained writeln by purpose, same for import std? ``` import std; int[] evenNumbers(int[] numbers) { return numbers.filter!(n => n % 2 == 0).array; } void main() { [1, 2, 3, 4].evenNumbers.writeln; } ``` Kind regards Andre Oop! Chaining the writeln too could have increased the wow factor. I didn't see that.
Re: Article: the feature that makes D my favorite programming language
On Friday, 24 July 2020 at 20:34:17 UTC, aberba wrote: Wrote something on the feature that makes D my favorite programming language https://opensource.com/article/20/7/d-programming Great article. I assume you didn't chained writeln by purpose, same for import std? ``` import std; int[] evenNumbers(int[] numbers) { return numbers.filter!(n => n % 2 == 0).array; } void main() { [1, 2, 3, 4].evenNumbers.writeln; } ``` Kind regards Andre