Re: What is your favorite D feature?

2017-06-24 Thread via Digitalmars-d
On Friday, 23 June 2017 at 18:51:13 UTC, Anonymouse wrote: On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: Hi, I am currently trying to modernize the D code example roulette on the dlang.org front page [1]. Hence, I would love to hear about your favorite feature(s) in D. Ideas: -

Re: What is your favorite D feature?

2017-06-23 Thread H. S. Teoh via Digitalmars-d
On Thu, Jun 22, 2017 at 12:48:25AM +, Seb via Digitalmars-d wrote: > Hi, > > I am currently trying to modernize the D code example roulette on the > dlang.org front page [1]. Hence, I would love to hear about your > favorite feature(s) in D. > Ideas: > - favorite language construct > -

Re: What is your favorite D feature?

2017-06-23 Thread H. S. Teoh via Digitalmars-d
On Fri, Jun 23, 2017 at 06:51:13PM +, Anonymouse via Digitalmars-d wrote: [...] > Fairly specific, but foreach (member; someStruct.tupleof). > > Part of my work on my IRC bot has been to serialise structs into > configuration files (since std.json was *non-trivial* to deal with), > and

Re: What is your favorite D feature?

2017-06-23 Thread Anonymouse via Digitalmars-d
On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: Hi, I am currently trying to modernize the D code example roulette on the dlang.org front page [1]. Hence, I would love to hear about your favorite feature(s) in D. Ideas: - favorite language construct - favorite code sample - "only

Re: What is your favorite D feature?

2017-06-23 Thread Kagamin via Digitalmars-d
On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: Before you ask, yes - I want to add a couple of cool examples to dlang.org (and yep the roulette rotation is currently broken [2]). [1] https://github.com/dlang/dlang.org/pulls?q=is%3Apr+is%3Aopen+label%3A%22Frontpage+example%22 [2]

Re: What is your favorite D feature?

2017-06-22 Thread Andrey via Digitalmars-d
UDA snippet: class MyView : View { @ViewWidget Button okButton; @ViewWidget("cancelButton") Button myButton; @GroupViewWidgets Button[3] buttons; @OnClickListener("okButton") void onOkButtonClick(Widget widget) { ... } @Shortcut("TestGroup.cancel") void

Re: What is your favorite D feature?

2017-06-22 Thread Andrey via Digitalmars-d
On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: Hi, I am currently trying to modernize the D code example roulette on the dlang.org front page [1]. Hence, I would love to hear about your favorite feature(s) in D. Ideas: - favorite language construct - favorite code sample - "only

Re: What is your favorite D feature? [Call for snippets]

2017-06-22 Thread Patrick Schluter via Digitalmars-d
On Thursday, 22 June 2017 at 07:00:17 UTC, Seb wrote: Thanks a lot, but I was looking for small snippets (< 10 LoC) than could be used to show the awesomeness of D at the roulette enum E {IN = -1, V1, V2, V3, X1 } mixin({ string code = "enum EBIT : ulong { "~

Re: What is your favorite D feature? [Call for snippets]

2017-06-22 Thread Ecstatic Coder via Digitalmars-d
Thanks a lot, but I was looking for small snippets (< 10 LoC) than could be used to show the awesomeness of D at the roulette on https://dlang.org Any chance you could make your point a bit conciser? :) I agree with you, indeed it is much too long for a carousel ;) And it should be made even

Re: What is your favorite D feature?

2017-06-22 Thread Guillaume Piolat via Digitalmars-d
On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: Hi, I am currently trying to modernize the D code example roulette on the dlang.org front page [1]. Hence, I would love to hear about your favorite feature(s) in D. Ideas: - favorite language construct I think "alias this" is a good

Re: What is your favorite D feature?

2017-06-22 Thread k-five via Digitalmars-d
On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: Hi, I am currently trying to modernize the D code example roulette on the dlang.org front page [1]. Hence, I would love to hear about your favorite feature(s) in D. Ideas: - favorite language construct - favorite code sample - "only

Re: What is your favorite D feature?

2017-06-22 Thread Era Scarecrow via Digitalmars-d
On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: I would love to hear about your favorite feature(s) in D. Arrays include length along with the pointer. Very easy built-in array support with foreach Ranges, that don't treat their input types as 'pointers' and get all levels of

Re: What is your favorite D feature?

2017-06-22 Thread Seb via Digitalmars-d
On Thursday, 22 June 2017 at 08:52:27 UTC, qznc wrote: On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: [...] H. S. Teoh calendar: https://wiki.dlang.org/Component_programming_with_ranges [...] Yes that's a great example, but sadly not standalone - we can only use Phobos for the

Re: What is your favorite D feature?

2017-06-22 Thread qznc via Digitalmars-d
On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: Hi, I am currently trying to modernize the D code example roulette on the dlang.org front page [1]. Hence, I would love to hear about your favorite feature(s) in D. Ideas: - favorite language construct - favorite code sample - "only

Re: What is your favorite D feature? [Call for snippets]

2017-06-22 Thread Mike via Digitalmars-d
On Thursday, 22 June 2017 at 07:10:14 UTC, Seb wrote: Nice list, but I was actually looking for more concise, actionable snippets or idea(s) for such. There are some real gems in this DConf Talk: https://www.youtube.com/watch?v=yMNMV9JlkcQ I started enumerating them on the Wiki here

Re: What is your favorite D feature? [Call for snippets]

2017-06-22 Thread Seb via Digitalmars-d
On Thursday, 22 June 2017 at 01:00:42 UTC, Mike wrote: Beginning with most favorite: - CTFE - static if - If you don't consider that part of CTFE - Template Mixins - Templates - Pretty much goes along with the top 2 - String Mixins - Unit Tests DIP1000 may make that list too, if I ever

Re: What is your favorite D feature? [Call for snippets]

2017-06-22 Thread Seb via Digitalmars-d
On Thursday, 22 June 2017 at 06:08:07 UTC, Paulo Pinto wrote: On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: Hi, I am currently trying to modernize the D code example roulette on the dlang.org front page [1]. Hence, I would love to hear about your favorite feature(s) in D. Ideas: -

Re: What is your favorite D feature? [Call for snippets]

2017-06-22 Thread Seb via Digitalmars-d
On Thursday, 22 June 2017 at 06:02:54 UTC, bauss wrote: On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: Hi, I am currently trying to modernize the D code example roulette on the dlang.org front page [1]. Hence, I would love to hear about your favorite feature(s) in D. Ideas: -

Re: What is your favorite D feature? [Call for snippets]

2017-06-22 Thread Seb via Digitalmars-d
On Thursday, 22 June 2017 at 06:27:11 UTC, Ecstatic Coder wrote: Absolutely no syntactic noise !!! This is often overlooked, while D easily beats all its direct competitors (C++, Java, C#, etc) on that point. Just try to implement the same code as simply in C++ and you will be convinced

Re: What is your favorite D feature?

2017-06-22 Thread Ecstatic Coder via Digitalmars-d
Lack of verbosity. Clear concise code, thanks to the automatic initialization of class members, native strings/arrays/maps/slices, UFCS, declaration-order independence, etc. class TOTO { bool IsCool; int Age; TUTU[] Tutus; TOTO[string] Totos; void Foo( TUTU tutu ) {

Re: What is your favorite D feature?

2017-06-22 Thread Paulo Pinto via Digitalmars-d
On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: Hi, I am currently trying to modernize the D code example roulette on the dlang.org front page [1]. Hence, I would love to hear about your favorite feature(s) in D. Ideas: - favorite language construct - favorite code sample - "only

Re: What is your favorite D feature?

2017-06-22 Thread bauss via Digitalmars-d
On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: Hi, I am currently trying to modernize the D code example roulette on the dlang.org front page [1]. Hence, I would love to hear about your favorite feature(s) in D. Ideas: - favorite language construct - favorite code sample - "only

Re: What is your favorite D feature?

2017-06-21 Thread ketmar via Digitalmars-d
"friendship ".writeln = ((_) => "is"~_)(" magic"); "friendship ".writeln = ((_) => "is"~_)(" magic"); just couldn't resist the temptaion, sorry.

Re: What is your favorite D feature?

2017-06-21 Thread Jon Degenhardt via Digitalmars-d
On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: Hi, I am currently trying to modernize the D code example roulette on the dlang.org front page [1]. Hence, I would love to hear about your favorite feature(s) in D. A couple more: - std.conv.to - Safe, convenient conversions that just

Re: What is your favorite D feature?

2017-06-21 Thread Seb via Digitalmars-d
On Thursday, 22 June 2017 at 01:42:10 UTC, Brad Anderson wrote: A very simple vibe app could be added using dub's single-file package format. Hmm this is a great idea, but it wouldn't be "runnable" on the web. Here's a PR for discussion: https://github.com/dlang/dlang.org/pull/1763

Re: What is your favorite D feature?

2017-06-21 Thread Seb via Digitalmars-d
On Thursday, 22 June 2017 at 01:13:43 UTC, H. S. Teoh wrote: Slices! And preferably in an example where it beats C performance by not needing to duplicate strings everywhere. There's one in the queue, feel free to vote for or destroy it: https://github.com/dlang/dlang.org/pull/1756 Built-in

Re: What is your favorite D feature?

2017-06-21 Thread Jon Degenhardt via Digitalmars-d
On Thursday, 22 June 2017 at 01:13:43 UTC, H. S. Teoh wrote: On Thu, Jun 22, 2017 at 12:48:25AM +, Seb via Digitalmars-d wrote: [snip] Slices! And preferably in an example where it beats C performance by not needing to duplicate strings everywhere. ... For slices the example in blog

Re: What is your favorite D feature?

2017-06-21 Thread Eugene Wissner via Digitalmars-d
On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: Hi, I am currently trying to modernize the D code example roulette on the dlang.org front page [1]. Hence, I would love to hear about your favorite feature(s) in D. Ideas: - favorite language construct - favorite code sample - "only

Re: What is your favorite D feature?

2017-06-21 Thread Brad Anderson via Digitalmars-d
On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: Hi, I am currently trying to modernize the D code example roulette on the dlang.org front page [1]. Hence, I would love to hear about your favorite feature(s) in D. Ideas: - favorite language construct - favorite code sample - "only

Re: What is your favorite D feature?

2017-06-21 Thread H. S. Teoh via Digitalmars-d
On Thu, Jun 22, 2017 at 12:48:25AM +, Seb via Digitalmars-d wrote: > Hi, > > I am currently trying to modernize the D code example roulette on the > dlang.org front page [1]. Hence, I would love to hear about your > favorite feature(s) in D. > > Ideas: > - favorite language construct > -

Re: What is your favorite D feature?

2017-06-21 Thread Adam D. Ruppe via Digitalmars-d
My fav is that familiar code just works.

Re: What is your favorite D feature?

2017-06-21 Thread Mike via Digitalmars-d
On Thursday, 22 June 2017 at 00:48:25 UTC, Seb wrote: I would love to hear about your favorite feature(s) in D. Beginning with most favorite: - CTFE - static if - If you don't consider that part of CTFE - Template Mixins - Templates - Pretty much goes along with the top 2 - String Mixins

What is your favorite D feature?

2017-06-21 Thread Seb via Digitalmars-d
Hi, I am currently trying to modernize the D code example roulette on the dlang.org front page [1]. Hence, I would love to hear about your favorite feature(s) in D. Ideas: - favorite language construct - favorite code sample - "only possible in D" Before you ask, yes - I want to add a couple