Re: Determine if CTFE or RT

2018-06-24 Thread Mr.Bingo via Digitalmars-d-learn
On Monday, 25 June 2018 at 05:14:31 UTC, Jonathan M Davis wrote: On Monday, June 25, 2018 05:03:26 Mr.Bingo via Digitalmars-d-learn wrote: The compiler should be easily able to figure out that foo(3) can be precomputed(ctfe'ed) and do so. It can already do this, as you say, by forcing enum on i

Re: Determine if CTFE or RT

2018-06-24 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, June 25, 2018 05:03:26 Mr.Bingo via Digitalmars-d-learn wrote: > The compiler should be easily able to figure out that foo(3) can > be precomputed(ctfe'ed) and do so. It can already do this, as you > say, by forcing enum on it. Why can't the compiler figure it out > directly? The big pr

Re: Determine if CTFE or RT

2018-06-24 Thread Mr.Bingo via Digitalmars-d-learn
On Sunday, 24 June 2018 at 20:03:19 UTC, arturg wrote: On Sunday, 24 June 2018 at 19:10:36 UTC, Mr.Bingo wrote: On Sunday, 24 June 2018 at 18:21:09 UTC, rjframe wrote: On Sun, 24 Jun 2018 14:43:09 +, Mr.Bingo wrote: let is(CTFE == x) mean that x is a compile time constant. CTFE(x) convert

Re: Wrapping a forward range in another forward range

2018-06-24 Thread aliak via Digitalmars-d-learn
On Sunday, 24 June 2018 at 20:33:32 UTC, Rudy Raab wrote: So I have an XLSX (MS Excel 2007+ file format) library that I wrote (https://github.com/TransientResponse/dlang-xlsx) that I recently converted from std.xml to dxml. That went well and it still works (much faster too). [...] I think

template sequence parameters treats member functions differently?

2018-06-24 Thread aliak via Digitalmars-d-learn
Hi, I'm having some issues with template sequence parameters, it seems they are not typed as delegates inside a template, but are outside. I.e. template T(V...) { alias T = typeof(&V[0]); } struct S { void f() {} } S s; pragma(msg, T!(s.f)); // void function() pragma(msg, typeof(&s.f)); /

Wrapping a forward range in another forward range

2018-06-24 Thread Rudy Raab via Digitalmars-d-learn
So I have an XLSX (MS Excel 2007+ file format) library that I wrote (https://github.com/TransientResponse/dlang-xlsx) that I recently converted from std.xml to dxml. That went well and it still works (much faster too). Now I had the idea that a lazy forward range API (like dxml itself or std

Re: Determine if CTFE or RT

2018-06-24 Thread arturg via Digitalmars-d-learn
On Sunday, 24 June 2018 at 19:10:36 UTC, Mr.Bingo wrote: On Sunday, 24 June 2018 at 18:21:09 UTC, rjframe wrote: On Sun, 24 Jun 2018 14:43:09 +, Mr.Bingo wrote: let is(CTFE == x) mean that x is a compile time constant. CTFE(x) converts a x to this compile time constant. Passing any compil

Re: Determine if CTFE or RT

2018-06-24 Thread Mr.Bingo via Digitalmars-d-learn
On Sunday, 24 June 2018 at 18:21:09 UTC, rjframe wrote: On Sun, 24 Jun 2018 14:43:09 +, Mr.Bingo wrote: let is(CTFE == x) mean that x is a compile time constant. CTFE(x) converts a x to this compile time constant. Passing any compile time constant essentially turns the variable in to a co

Re: Determine if CTFE or RT

2018-06-24 Thread Stefan Koch via Digitalmars-d-learn
On Sunday, 24 June 2018 at 18:21:09 UTC, rjframe wrote: On Sun, 24 Jun 2018 14:43:09 +, Mr.Bingo wrote: let is(CTFE == x) mean that x is a compile time constant. CTFE(x) converts a x to this compile time constant. Passing any compile time constant essentially turns the variable in to a co

Re: Determine if CTFE or RT

2018-06-24 Thread rjframe via Digitalmars-d-learn
On Sun, 24 Jun 2018 14:43:09 +, Mr.Bingo wrote: > let is(CTFE == x) mean that x is a compile time constant. CTFE(x) > converts a x to this compile time constant. Passing any compile time > constant essentially turns the variable in to a compile time > constant(effectively turns it in to a temp

Re: Can I parse this kind of HTML with arsd.dom module?

2018-06-24 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 24 June 2018 at 10:49:51 UTC, Timoses wrote: https://hostname.com/?file=foo.png&foo=baa";>G! missing Seems to be buggy, the parsed document part refering to "a" looks like this: G! It reads href as a no content attribute (like `checked` which becomes `checked="check

Re: Can I parse this kind of HTML with arsd.dom module?

2018-06-24 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 24 June 2018 at 03:46:09 UTC, Dr.No wrote: I know the library author post on this forum often, I hope he see this help somehow Yeah, I'm out this week but it shouldn't be too hard to add, the garbage attribute parser can special-case = surrounded by spaces to just skip the spaces.

Re: Debugging compile time memory usage

2018-06-24 Thread Stefan Koch via Digitalmars-d-learn
On Sunday, 24 June 2018 at 14:16:26 UTC, Kamil Koczurek wrote: I recently wrote a brainfuck compiler in D, which loads the BF source at compile time, performs some (simple) optimizations, translates everything to D and puts it into the source code with a mixin. I did manage to get some pretty

Determine if CTFE or RT

2018-06-24 Thread Mr.Bingo via Digitalmars-d-learn
let is(CTFE == x) mean that x is a compile time constant. CTFE(x) converts a x to this compile time constant. Passing any compile time constant essentially turns the variable in to a compile time constant(effectively turns it in to a template with template parameter) void foo(size_t i) {

Debugging compile time memory usage

2018-06-24 Thread Kamil Koczurek via Digitalmars-d-learn
I recently wrote a brainfuck compiler in D, which loads the BF source at compile time, performs some (simple) optimizations, translates everything to D and puts it into the source code with a mixin. I did manage to get some pretty good performance, but for some programs in brainfuck I have to

Re: Using systemDependencies in DUB

2018-06-24 Thread Dechcaudron via Digitalmars-d-learn
On Sunday, 24 June 2018 at 12:15:42 UTC, Timoses wrote: What about the "libs" build settings (or "lflags")? (http://code.dlang.org/package-format?lang=json) "libs": "clang" There it was, hidden in plain sight. Thanks for the extra pair of eyes Timoses. I don't know how I missed it. Succe

Re: Using systemDependencies in DUB

2018-06-24 Thread Timoses via Digitalmars-d-learn
On Sunday, 24 June 2018 at 11:44:06 UTC, Dechcaudron wrote: Hi, I'm trying to use dub to compile a quick experiment that uses Deimos libclang bindings, which of course requires linking against an installed libclang. I believe this is what I need to include in dub.json: "systemDependencies"

GTKD release event in windows

2018-06-24 Thread ANtlord via Digitalmars-d-learn
Hello! Has somebody ever encountered continually triggering of key released event while the key is pressed with GTKD? I have the same issue for key pressed event but it's not so critical for me. The problem is occurred for all key keys except a key-modifier like alt, ctrl and shift. Also, it

Using systemDependencies in DUB

2018-06-24 Thread Dechcaudron via Digitalmars-d-learn
Hi, I'm trying to use dub to compile a quick experiment that uses Deimos libclang bindings, which of course requires linking against an installed libclang. I believe this is what I need to include in dub.json: "systemDependencies": "libclang-6.0" But it just won't link against the lib in t

Re: Can I parse this kind of HTML with arsd.dom module?

2018-06-24 Thread Timoses via Digitalmars-d-learn
On Sunday, 24 June 2018 at 03:46:09 UTC, Dr.No wrote: string html = get(page, client).text; auto document = new Document(); document.parseGarbage(html); Element attEle = document.querySelector("span[id=link2]"); Element aEle = attEle.querySelector("a"); string link

Re: what is the point of functor ?

2018-06-24 Thread Flaze07 via Digitalmars-d-learn
On Friday, 22 June 2018 at 20:20:56 UTC, Steven Schveighoffer wrote: On 6/22/18 2:25 PM, Ali Çehreli wrote: On 06/22/2018 08:17 AM, Steven Schveighoffer wrote: > reason to use functors I wonder whether they are more efficient because a functor would carry just the state that it needs. Also,