Re: real simple manifest constant question probably regret asking...

2017-03-15 Thread Ali Çehreli via Digitalmars-d-learn
On 03/15/2017 08:27 PM, WhatMeForget wrote: > > One of my D books says: "an enum declared without any braces is called a > manifest constant." The example shows, > > enum string author = "Mike Parker"; > > Is this equivalent to > const string author = "Mike Parker"; > or > immutable string author

Re: real simple manifest constant question probably regret asking...

2017-03-15 Thread ketmar via Digitalmars-d-learn
WhatMeForget wrote: One of my D books says: "an enum declared without any braces is called a manifest constant." The example shows, enum string author = "Mike Parker"; Is this equivalent to const string author = "Mike Parker"; or immutable string author = "Mike Parker"; I guess what I'm aski

Re: real simple manifest constant question probably regret asking...

2017-03-15 Thread rikki cattermole via Digitalmars-d-learn
On 16/03/2017 4:27 PM, WhatMeForget wrote: One of my D books says: "an enum declared without any braces is called a manifest constant." The example shows, enum string author = "Mike Parker"; Is this equivalent to const string author = "Mike Parker"; or immutable string author = "Mike Parker";

real simple manifest constant question probably regret asking...

2017-03-15 Thread WhatMeForget via Digitalmars-d-learn
One of my D books says: "an enum declared without any braces is called a manifest constant." The example shows, enum string author = "Mike Parker"; Is this equivalent to const string author = "Mike Parker"; or immutable string author = "Mike Parker"; I guess what I'm asking is does enum give

Re: scope(~this)

2017-03-15 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Mar 15, 2017 at 08:55:34PM +, Adam D. Ruppe via Digitalmars-d-learn wrote: [...] > > However, if there are two mixin templates both declaring > > this(), the compiler dies with an ICE. :-D > > eek. Filed a bug for it: https://issues.dlang.org/show_bug.cgi?id=17259 T --

Re: DMD + Dynamic Library.

2017-03-15 Thread Damien Gibson via Digitalmars-d-learn
I have an example of how to create a dll in d, read in c and d, if you want I can post the files, it's just an example to clarify, I use windows 10 32b and dmd 2.72 - yes my english is Too bad ... sorry. I speak Brazilian Portuguese. I would love that :D And no dont worry your english was perf

Re: scope(~this)

2017-03-15 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 15 March 2017 at 20:36:27 UTC, H. S. Teoh wrote: But if the class declares this() and the (single) mixin template also declares this(), then the mixin template's version is ignored and the class-declared this() is run upon construction. That's normal mixin template behavior: if

Re: scope(~this)

2017-03-15 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Mar 15, 2017 at 12:34:32PM -0700, Ali Çehreli via Digitalmars-d-learn wrote: > On 03/15/2017 03:23 AM, Basile B. wrote: > > > you can use a mixin template because they can introduce destructors > > that are called automatically with the aggregate destrcutor > > > > mixin template Foo(T) >

Re: [vibe.d] How to create authentication system via REST interface?

2017-03-15 Thread Ali Çehreli via Digitalmars-d-learn
On 03/15/2017 07:06 AM, Suliman wrote: > You need to look at JWT. WekaIO uses jwtd, with minor improvements on it (improved error handling and code coverage): https://github.com/weka-io/jwtd Ali

Re: scope(~this)

2017-03-15 Thread Ali Çehreli via Digitalmars-d-learn
On 03/15/2017 03:23 AM, Basile B. wrote: > you can use a mixin template because > they can introduce destructors that are called automatically with the > aggregate destrcutor > > mixin template Foo(T) > { > T x; > void foo() > { > alloc(x); > } > ~this() // auto-called

Re: strange CFTE issue

2017-03-15 Thread ag0aep6g via Digitalmars-d-learn
Phobos has it: std.meta.aliasSeqOf "converts an input range [...] to an alias sequence." [1] Woops, forgot to give the URL for that "[1]". Here it is: http://dlang.org/phobos/std_meta.html#aliasSeqOf

Re: strange CFTE issue

2017-03-15 Thread ag0aep6g via Digitalmars-d-learn
On 03/15/2017 02:00 PM, Inquie wrote: Thanks, it explains it, but there is one difference. The array is assigned to an enum, so surely the compiler can figure that out? It should be similar to AliasSeq. The enum array is similar to an AliasSeq in that you can them both in contexts that require

Re: scope(~this)

2017-03-15 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 15 March 2017 at 12:56:10 UTC, Inquie wrote: If it is trivial, can you write up a quick solution. I don't see how to accomplish it easily. Here it is, source and output: https://dpaste.dzfl.pl/bbf162529c6c

Re: [vibe.d] How to create authentication system via REST interface?

2017-03-15 Thread aberba via Digitalmars-d-learn
On Wednesday, 15 March 2017 at 13:24:07 UTC, NX wrote: I'm trying to understand how to create some json-rest api that would return data (in json format) related to that specific logged in user. I see the documentation covers these but I'm totally new to vibe.d so can't quite figure out putting

Safe COM Variant

2017-03-15 Thread Hussien via Digitalmars-d-learn
Is there a safe com variant? We need to call To use a variant properly we must 1. CoTaskMemAlloc 2. VariantInit 3. VariantClear 4. CoTaskMemFree With 1/4 COM calls randomly crash/fail. (which is what lead me to use them) 2/3 are specified by COM spec. I guess D doesn't have a SafeVariant t

Re: What is PostgreSQL driver is most stable?

2017-03-15 Thread Suliman via Digitalmars-d-learn
The retrieval of records is done via the execution of a (prepared) sql query, that returns a range object (PGResultSet), and the element of that range is the DBRow, in one of its form. So, basically, the elements are retrieved on demand while you popFront that range, leveraging what the Postg

Re: [vibe.d] How to create authentication system via REST interface?

2017-03-15 Thread Suliman via Digitalmars-d-learn
On Wednesday, 15 March 2017 at 13:24:07 UTC, NX wrote: I'm trying to understand how to create some json-rest api that would return data (in json format) related to that specific logged in user. I see the documentation covers these but I'm totally new to vibe.d so can't quite figure out putting

[vibe.d] How to create authentication system via REST interface?

2017-03-15 Thread NX via Digitalmars-d-learn
I'm trying to understand how to create some json-rest api that would return data (in json format) related to that specific logged in user. I see the documentation covers these but I'm totally new to vibe.d so can't quite figure out putting these two things together and make them work. Some easy

Re: What is PostgreSQL driver is most stable?

2017-03-15 Thread Paolo Invernizzi via Digitalmars-d-learn
On Wednesday, 15 March 2017 at 09:18:16 UTC, Suliman wrote: On Tuesday, 14 March 2017 at 13:36:04 UTC, Daniel Kozak wrote: Dne 14.3.2017 v 14:21 Daniel Kozak napsal(a): Dne 14.3.2017 v 14:13 Suliman via Digitalmars-d-learn napsal(a): I need to develop App that should work on Linux and Window

Re: debug mixins

2017-03-15 Thread Inquie via Digitalmars-d-learn
On Wednesday, 15 March 2017 at 03:50:21 UTC, Jonathan M Davis wrote: On Wednesday, March 15, 2017 03:43:20 Inquie via Digitalmars-d-learn wrote: [...] Related: https://issues.dlang.org/show_bug.cgi?id=5051 - Jonathan M Davis So, after 3 years, nothing?

Re: strange CFTE issue

2017-03-15 Thread Inquie via Digitalmars-d-learn
On Wednesday, 15 March 2017 at 03:40:42 UTC, ag0aep6g wrote: On 03/15/2017 03:01 AM, Inquie wrote: If I do something like enum X = Methods!(C); foreach(x; X) { mixin(x); } I get an error about x not being a compile time variable. (code above is simplified, the error has nothing to do wi

Re: scope(~this)

2017-03-15 Thread Inquie via Digitalmars-d-learn
On Wednesday, 15 March 2017 at 08:17:11 UTC, thedeemon wrote: On Tuesday, 14 March 2017 at 14:35:11 UTC, Inquie wrote: There is really no any arrays to keep track of or anything like that matter you stated. ... 3 steps: ... 3. The compiler calls all the delegates on destruction. Here you are.

Re: scope(~this)

2017-03-15 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 14 March 2017 at 14:35:11 UTC, Inquie wrote: On Tuesday, 14 March 2017 at 05:33:28 UTC, thedeemon wrote: [...] Complexity is in the eye of the beholder. Children think many things are complex when they are not. If a library solution could be created that is as seamless as a lan

Re: What is PostgreSQL driver is most stable?

2017-03-15 Thread Suliman via Digitalmars-d-learn
On Tuesday, 14 March 2017 at 13:36:04 UTC, Daniel Kozak wrote: Dne 14.3.2017 v 14:21 Daniel Kozak napsal(a): Dne 14.3.2017 v 14:13 Suliman via Digitalmars-d-learn napsal(a): I need to develop App that should work on Linux and Windows. It need PostgreSQL driver. I tried Vadim's ddbc for Post

Re: What is PostgreSQL driver is most stable?

2017-03-15 Thread Paolo Invernizzi via Digitalmars-d-learn
On Wednesday, 15 March 2017 at 08:50:11 UTC, Dsby wrote: On Tuesday, 14 March 2017 at 16:24:31 UTC, Paolo Invernizzi wrote: On Tuesday, 14 March 2017 at 13:32:31 UTC, Suliman wrote: On Tuesday, 14 March 2017 at 13:21:39 UTC, Paolo Invernizzi wrote: On Tuesday, 14 March 2017 at 13:13:31 UTC, Su

Re: What is PostgreSQL driver is most stable?

2017-03-15 Thread Dsby via Digitalmars-d-learn
On Tuesday, 14 March 2017 at 16:24:31 UTC, Paolo Invernizzi wrote: On Tuesday, 14 March 2017 at 13:32:31 UTC, Suliman wrote: On Tuesday, 14 March 2017 at 13:21:39 UTC, Paolo Invernizzi wrote: On Tuesday, 14 March 2017 at 13:13:31 UTC, Suliman wrote: [...] I'm using ddb [1], a full-D implemen

Re: scope(~this)

2017-03-15 Thread thedeemon via Digitalmars-d-learn
On Tuesday, 14 March 2017 at 14:35:11 UTC, Inquie wrote: There is really no any arrays to keep track of or anything like that matter you stated. ... 3 steps: ... 3. The compiler calls all the delegates on destruction. Here you are. "All the delegates" - where are they stored? This is the arra

Re: DMD + Dynamic Library.

2017-03-15 Thread Cassio Butrico via Digitalmars-d-learn
On Wednesday, 15 March 2017 at 07:03:19 UTC, Damien Gibson wrote: If it helps to know i also get in the other little window that tells me the activate compiler commands and stuff that the symbols for the functions i called undefined while the other side just said library reference not found.

Re: DMD + Dynamic Library.

2017-03-15 Thread Damien Gibson via Digitalmars-d-learn
If it helps to know i also get in the other little window that tells me the activate compiler commands and stuff that the symbols for the functions i called undefined while the other side just said library reference not found.