Re: Traits redux

2018-03-03 Thread arturg via Digitalmars-d-learn

On Saturday, 3 March 2018 at 16:20:57 UTC, JN wrote:

https://run.dlang.io/gist/ec7008372d60ac52460dd58068f1ca6d?compiler=dmd

Why only listUDA2 works and listUDA doesn't? Why do I need to 
use __traits(getMember again, if I use what I saved in a 
variable, it doesn't work :(


because getUDAs returns only instantiations and ignores templates
and scince hasUDA or getSymbolsByUDA uses it non of them work 
anymore. :(


based on run.dlang.io it worked with dmd 2.071.2


Traits redux

2018-03-03 Thread JN via Digitalmars-d-learn

https://run.dlang.io/gist/ec7008372d60ac52460dd58068f1ca6d?compiler=dmd

Why only listUDA2 works and listUDA doesn't? Why do I need to use 
__traits(getMember again, if I use what I saved in a variable, it 
doesn't work :(


glottolog-shh.mpg.de

2018-03-03 Thread dr-amelatuzsugiyanto via Digitalmars-d-learn

 glotto...@shh.mpg.de


Re: Equivalent to Python with Statement

2018-03-03 Thread phongkhamdakhoathegioi via Digitalmars-d-learn

On Thursday, 1 March 2018 at 07:34:38 UTC, Cym13 wrote:

On Wednesday, 28 February 2018 at 22:55:19 UTC, Seb wrote:

On Wednesday, 28 February 2018 at 21:47:40 UTC, Cym13 wrote:

[...]


I know that I am repeating myself, but manually closing the 
file isn't needed in D. It's refCounted and will be closed 
automatically once the scope is left. That's why 
`with(File("AAA","w"))` works in D.


As stated, yes that's an accurate answer to that particular 
problem and it's well understood, I'm just giving a more 
general answer that will work for every python context manager 
and not only on the  specific case of closing files.


http://phongkhamdakhoathegioi.vn/u-nang-buong-trung-dang-nuoc.html


Re: VibeD Rest Interface Generator

2018-03-03 Thread Johannes Loher via Digitalmars-d-learn

On Saturday, 3 March 2018 at 02:32:11 UTC, Mario wrote:
So I've been learning D since the day 11 (I posted for first 
time here) and now I've decided to try Vibe.D to make my 
company API.


The fact is that I've achieved to do it (according to the 
provided code) and it works! But it shows a default message and 
on the startup. So I'd like to know how can I set it to receive 
the HTTP(s) request, analyze the body and get the data through 
a database (we will probably use MongoDB).


If you can help me with this, I'd be grateful. Best regards, 
Mario :-)


These are quite a lot of questions at once and it is difficult, 
to answer them all here, because they are so general. I suggest 
you take a look at the excelent book D Web Development 
(https://www.packtpub.com/web-development/d-web-development) 
which covers everything you asked. Be aware  though that  new 
vibe.d Versions have been released since the Book has been 
published and so some of its information is outdated. so if you 
use a recent Version of vibe.d, be sure to also Check out the 
documentation.