Re: Why Dlang use parsing expression grammar (PEG) parser not BNF?

2019-11-01 Thread user4567 via Digitalmars-d-learn
On Thursday, 31 October 2019 at 08:40:42 UTC, lili wrote: Hi: I want implementation Lua on D, I find that a PEG parser https://github.com/PhilippeSigaud/Pegged why do not use BNF parser. Is PEG better than BNF? IIRC the PEG for D is not complete. You have an EBNF here

Re: Documentation: is it intentional that template constraints are displayed after the signature?

2019-11-01 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, November 1, 2019 11:23:42 AM MDT Ali Çehreli via Digitalmars-d- learn wrote: > On 11/01/2019 09:33 AM, Paul Backus wrote: > > On Friday, 1 November 2019 at 15:29:24 UTC, Ali Çehreli wrote: > >> Apparently, it's the version for static arrays. However, I don't think > >> the template

Re: Documentation: is it intentional that template constraints are displayed after the signature?

2019-11-01 Thread Ali Çehreli via Digitalmars-d-learn
On 11/01/2019 09:33 AM, Paul Backus wrote: > On Friday, 1 November 2019 at 15:29:24 UTC, Ali Çehreli wrote: >> Apparently, it's the version for static arrays. However, I don't think >> the template constraint is doing anything there because if T matches a >> static array (of the form U[n]), then

Re: Documentation: is it intentional that template constraints are displayed after the signature?

2019-11-01 Thread Paul Backus via Digitalmars-d-learn
On Friday, 1 November 2019 at 15:29:24 UTC, Ali Çehreli wrote: On 11/01/2019 04:09 AM, berni44 wrote: > What I don't understand is the 4th version with two extra parameters. > Here the documentation lacks an explanation, what this is good for. I went to the documentation by clicking "View

Re: Documentation: is it intentional that template constraints are displayed after the signature?

2019-11-01 Thread Ali Çehreli via Digitalmars-d-learn
On 11/01/2019 04:09 AM, berni44 wrote: > What I don't understand is the 4th version with two extra parameters. > Here the documentation lacks an explanation, what this is good for. I went to the documentation by clicking "View source code" and scrolled a bit and found this:

Re: Documentation: is it intentional that template constraints are displayed after the signature?

2019-11-01 Thread berni44 via Digitalmars-d-learn
On Thursday, 31 October 2019 at 13:34:35 UTC, Tobias Pankrath wrote: I was confused at first by the trailing if (!is(T == struct) && !is(T == interface) && !is(T == class) && !__traits(isStaticArray, T)); I understood your question different from what Dennis answered. At least I was

Re: Documentation: is it intentional that template constraints are displayed after the signature?

2019-11-01 Thread Tobias Pankrath via Digitalmars-d-learn
On Friday, 1 November 2019 at 09:17:03 UTC, Dennis wrote: Template constraints are not allowed before the signature in the language, so it can be expected the documentation does not swap that order. On Thursday, 31 October 2019 at 13:34:35 UTC, Tobias Pankrath wrote: I was confused at first

Store multiple identical objects in a key:ed datastructure?

2019-11-01 Thread Tove via Digitalmars-d-learn
Consider a complex key that is a combination of multiple variables. struct key { intfoo = 1; string bar = "joy"; string baz = "huzza"; } The value is a very large object. struct value { int[4096] payload; } There are 10.000s of different keys. But typically only ~10 different

Blog Post #84: Notebook, Part VIII - Child Widgets

2019-11-01 Thread Ron Tarrant via Digitalmars-d-learn
For the final instalment in the Notebook series, we take a look at accessing the contents of child widgets: https://gtkdcoding.com/2019/11/01/0084-notebook-viii-child-widgets.html

Re: Documentation: is it intentional that template constraints are displayed after the signature?

2019-11-01 Thread Dennis via Digitalmars-d-learn
Template constraints are not allowed before the signature in the language, so it can be expected the documentation does not swap that order. On Thursday, 31 October 2019 at 13:34:35 UTC, Tobias Pankrath wrote: I was confused at first by the trailing if (!is(T == struct) && !is(T ==

Re: Why Dlang use parsing expression grammar (PEG) parser not BNF?

2019-11-01 Thread Dennis via Digitalmars-d-learn
On Thursday, 31 October 2019 at 08:40:42 UTC, lili wrote: Hi: I want implementation Lua on D, I find that a PEG parser https://github.com/PhilippeSigaud/Pegged why do not use BNF parser. Is PEG better than BNF? The readme has a link to the reference article:

Re: Help playing sounds using arsd.simpleaudio

2019-11-01 Thread johnsmith101 via Digitalmars-d-learn
On Wednesday, 30 October 2019 at 19:11:00 UTC, Adam D. Ruppe wrote: On Saturday, 26 October 2019 at 19:48:33 UTC, Murilo wrote: I play a sound the program never ends, the terminal continues to run the program and I have to end it manually. Any ideas what could be causing this? I am using it