Re: SMTP Mail

2018-04-09 Thread Vino.B via Digitalmars-d-learn
On Monday, 9 April 2018 at 13:02:06 UTC, Adam D. Ruppe wrote: On Sunday, 8 April 2018 at 15:45:48 UTC, Vino wrote: I am trying your email.d programming, and i am getting the below errors, can you please help me, i just used these programs (characterencodings.d, color.d, dom.d, htmltotext.d,

Re: How to destruct class instances allocated by a Region-allocator over a single GC block

2018-04-09 Thread Per Nordlöw via Digitalmars-d-learn
On Monday, 9 April 2018 at 13:51:47 UTC, Steven Schveighoffer wrote: Well, you know the type, because make returned it no? The contract is, you call obj = make!X(args), then you have to call dispose(obj), where obj is of the type X. That's how it knows. If you are thinking you want to destroy

Re: Is std.variant.visit not @nogc?

2018-04-09 Thread Paul Backus via Digitalmars-d-learn
On Monday, 9 April 2018 at 07:07:58 UTC, Chris Katko wrote: On Monday, 9 April 2018 at 07:02:50 UTC, Hasen Judy wrote: IMO, this is one more reason why sum-types should be built into the language compiler, instead of being implemented in user-space. +1. Any time you have to "create" a

Re: SMTP Mail

2018-04-09 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 9 April 2018 at 15:38:55 UTC, Vino.B wrote: Thank you very much, I copied your folder arsd under the phobes folder in c:\D\... and the program was placed on my desktop and tried to execute it from the desktop via rdmd. I don't think rdmd is seeing the dependency on htmltotext.d.

Re: Parse .eml files

2018-04-09 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 9 April 2018 at 18:47:16 UTC, bachmeier wrote: Is there a way to do this in D? The email libraries I've found don't appear to work with .eml. My understanding is .eml is the same MIME format the email itself and mbox and maildir all use. So any of those libraries are likely to

Re: Parse .eml files

2018-04-09 Thread bachmeier via Digitalmars-d-learn
On Monday, 9 April 2018 at 19:17:20 UTC, Adam D. Ruppe wrote: My understanding is .eml is the same MIME format the email itself and mbox and maildir all use. Thanks. I didn't know that. I will try it using email.d.

Re: Source expression passed to a lazy parameter

2018-04-09 Thread Seb via Digitalmars-d-learn
On Monday, 9 April 2018 at 13:03:38 UTC, Simen Kjærås wrote: On Monday, 9 April 2018 at 11:33:56 UTC, Alex wrote: On Monday, 9 April 2018 at 09:20:42 UTC, Simen Kjærås wrote: Nope. Something along the lines of __traits(getSource, arg) has been discussed occasionally. Is this available

Strange Thread Causing Duplicating `writeln`

2018-04-09 Thread Jonathan via Digitalmars-d-learn
I am totally lost on why this is happening. I stripped the code down to what appears to be the most minimal code that still causes the problem. --- import core.sync.mutex; import core.thread; import std.stdio; __gshared Mutex m;//__gshared just for testing (; void thread1() {

Re: Strange Thread Causing Duplicating `writeln`

2018-04-09 Thread Cym13 via Digitalmars-d-learn
On Monday, 9 April 2018 at 22:28:45 UTC, Jonathan wrote: I am totally lost on why this is happening. I stripped the code down to what appears to be the most minimal code that still causes the problem. --- import core.sync.mutex; import core.thread; import std.stdio; __gshared Mutex

Re: Strange Thread Causing Duplicating `writeln`

2018-04-09 Thread Jonathan via Digitalmars-d-learn
On Monday, 9 April 2018 at 22:49:07 UTC, Cym13 wrote: I don't know, but I can't reproduce either with dmd or ldc. What was your compilation line? dmd -run file.d

Re: Strange Thread Causing Duplicating `writeln`

2018-04-09 Thread Jonathan via Digitalmars-d-learn
On Monday, 9 April 2018 at 22:53:31 UTC, Jonathan wrote: On Monday, 9 April 2018 at 22:49:07 UTC, Cym13 wrote: I don't know, but I can't reproduce either with dmd or ldc. What was your compilation line? dmd -run file.d I am on Window 10 btw.

Re: Should the "front" range primitive be "const" ?

2018-04-09 Thread Drone1h via Digitalmars-d-learn
On Monday, 19 March 2018 at 00:50:06 UTC, Jonathan M Davis wrote: [...] http://jmdavisprog.com/articles/why-const-sucks.html I have just read the reply and the article. I cannot believe you have written this article in response to this thread (perhaps I am mis-interpreting the date of the

Re: Is std.variant.visit not @nogc?

2018-04-09 Thread helxi via Digitalmars-d-learn
On Monday, 9 April 2018 at 15:59:32 UTC, Paul Backus wrote: On Monday, 9 April 2018 at 07:07:58 UTC, Chris Katko wrote: [...] I agree in general, but in this case it's actually completely doable. In fact, I've done it myself: check out 'sumtype' on code.dlang.org. You can replace

Re: Strange Thread Causing Duplicating `writeln`

2018-04-09 Thread Jonathan via Digitalmars-d-learn
On Monday, 9 April 2018 at 22:56:33 UTC, Jonathan wrote: On Monday, 9 April 2018 at 22:53:31 UTC, Jonathan wrote: On Monday, 9 April 2018 at 22:49:07 UTC, Cym13 wrote: I don't know, but I can't reproduce either with dmd or ldc. What was your compilation line? dmd -run file.d I am on Window

Re: Should the "front" range primitive be "const" ?

2018-04-09 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, April 09, 2018 23:58:02 Drone1h via Digitalmars-d-learn wrote: > On Monday, 19 March 2018 at 00:50:06 UTC, Jonathan M Davis wrote: > > [...] > > http://jmdavisprog.com/articles/why-const-sucks.html > > I have just read the reply and the article. > > I cannot believe you have written

Re: Is std.variant.visit not @nogc?

2018-04-09 Thread Paul Backus via Digitalmars-d-learn
On Tuesday, 10 April 2018 at 00:22:18 UTC, helxi wrote: On Monday, 9 April 2018 at 15:59:32 UTC, Paul Backus wrote: On Monday, 9 April 2018 at 07:07:58 UTC, Chris Katko wrote: [...] I agree in general, but in this case it's actually completely doable. In fact, I've done it myself: check out

Parse .eml files

2018-04-09 Thread bachmeier via Digitalmars-d-learn
I want to save all email messages related to a research project into a directory, call a D program to generate an index of all messages, and push it to the repo server. That way all coauthors have access to all email messages even if they joined a project after several years. My client is

Re: Source expression passed to a lazy parameter

2018-04-09 Thread Simen Kjærås via Digitalmars-d-learn
On Monday, 9 April 2018 at 08:27:50 UTC, Per Nordlöw wrote: Is it possible to get the source expression sent to a lazy function? Nope. Something along the lines of __traits(getSource, arg) has been discussed occasionally. For lazy what you're asking is impossible, since the compiler

Re: Benchmarking sigmoid function between C and D

2018-04-09 Thread kinke via Digitalmars-d-learn
On Saturday, 7 April 2018 at 21:53:23 UTC, Guillaume Piolat wrote: Have you tried LLVM intrinsics? say llvm_exp While LLVM does have math intrinsics, they seem to boil down to C runtime calls in many/most cases. I.e., on Linux x86_64, `llvm_exp(real)` simply maps to the C function `expl()`

Source expression passed to a lazy parameter

2018-04-09 Thread Per Nordlöw via Digitalmars-d-learn
Is it possible to get the source expression sent to a lazy function? So that I can implement something like show(Arg)(lazy Arg arg) { writeln(arg.sourceof, arg); } used as show(1+2+3); will print 1+2+3:6

Re: Source expression passed to a lazy parameter

2018-04-09 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, April 09, 2018 08:27:50 Per Nordlöw via Digitalmars-d-learn wrote: > Is it possible to get the source expression sent to a lazy > function? > > So that I can implement something like > > show(Arg)(lazy Arg arg) > { > writeln(arg.sourceof, arg); > } > > used as > >

Re: Source expression passed to a lazy parameter

2018-04-09 Thread Basile B. via Digitalmars-d-learn
On Monday, 9 April 2018 at 08:27:50 UTC, Per Nordlöw wrote: Is it possible to get the source expression sent to a lazy function? So that I can implement something like show(Arg)(lazy Arg arg) { writeln(arg.sourceof, arg); } used as show(1+2+3); will print 1+2+3:6 No (afaik),

Re: toString contains null for struct with function/method

2018-04-09 Thread number via Digitalmars-d-learn
On Sunday, 8 April 2018 at 15:51:05 UTC, Paul Backus wrote: On Sunday, 8 April 2018 at 15:04:49 UTC, number wrote: writeln(s2);// S2(0, null) S2 is a nested struct [1], which means it has a hidden pointer field that's used to access its enclosing scope. If you change

Re: Source expression passed to a lazy parameter

2018-04-09 Thread Alex via Digitalmars-d-learn
On Monday, 9 April 2018 at 09:20:42 UTC, Simen Kjærås wrote: Nope. Something along the lines of __traits(getSource, arg) has been discussed occasionally. Is this available somehow? And/or do you have a link to the discussion, maybe?

Re: SMTP Mail

2018-04-09 Thread Vino via Digitalmars-d-learn
On Sunday, 8 April 2018 at 15:45:48 UTC, Vino wrote: On Friday, 25 August 2017 at 02:13:42 UTC, Adam D. Ruppe wrote: [...] Hi Adam, I am trying your email.d programming, and i am getting the below errors, can you please help me, i just used these programs (characterencodings.d, color.d,

Re: SMTP Mail

2018-04-09 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 8 April 2018 at 15:45:48 UTC, Vino wrote: I am trying your email.d programming, and i am getting the below errors, can you please help me, i just used these programs (characterencodings.d, color.d, dom.d, htmltotext.d, email.d) What is your build command? It looks like a module

Re: Source expression passed to a lazy parameter

2018-04-09 Thread Simen Kjærås via Digitalmars-d-learn
On Monday, 9 April 2018 at 11:33:56 UTC, Alex wrote: On Monday, 9 April 2018 at 09:20:42 UTC, Simen Kjærås wrote: Nope. Something along the lines of __traits(getSource, arg) has been discussed occasionally. Is this available somehow? And/or do you have a link to the discussion, maybe?

Re: Source expression passed to a lazy parameter

2018-04-09 Thread Stefan Koch via Digitalmars-d-learn
On Monday, 9 April 2018 at 08:27:50 UTC, Per Nordlöw wrote: Is it possible to get the source expression sent to a lazy function? So that I can implement something like show(Arg)(lazy Arg arg) { writeln(arg.sourceof, arg); } used as show(1+2+3); will print 1+2+3:6 Because of

Re: How to destruct class instances allocated by a Region-allocator over a single GC block

2018-04-09 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/7/18 10:57 AM, Per Nordlöw wrote: On Saturday, 7 April 2018 at 07:50:37 UTC, Eduard Staniloiu wrote: On Friday, 6 April 2018 at 21:49:37 UTC, Per Nordlöw wrote: On Tuesday, 3 April 2018 at 09:14:28 UTC, Eduard Staniloiu wrote: So, say `reg` is your allocator, your workflow would be auto