Re: Making an .exe that executes source file inside itself.

2018-04-25 Thread IntegratedDimensions via Digitalmars-d-learn
On Wednesday, 25 April 2018 at 19:19:58 UTC, BoQsc wrote: So there has been idea I've got for around few months now: making a software which executable would contain a source file. A software that anyone could modify by opening an executable and quickly change a few lines of it, rerun an

Re: Making an .exe that executes source file inside itself.

2018-04-25 Thread u0_a183 via Digitalmars-d-learn
On Wednesday, 25 April 2018 at 19:54:26 UTC, BoQsc wrote: On Wednesday, 25 April 2018 at 19:43:31 UTC, Jonathan M Davis wrote: On Wednesday, April 25, 2018 19:19:58 BoQsc via Digitalmars-d-learn wrote: So there has been idea I've got for around few months now: making a software which

Re: Using an external Assembler with D

2018-04-25 Thread solidstate1991 via Digitalmars-d-learn
On Wednesday, 25 April 2018 at 15:25:42 UTC, Stefan Koch wrote: Pass stuff on the stack ;) and use extern (C) functions. Thanks! What about extern (D)? Is there a big chaos in the D ABI under x86?

Re: Sense check: construction / deconstruction

2018-04-25 Thread Jordan Wilson via Digitalmars-d-learn
On Wednesday, 25 April 2018 at 13:52:16 UTC, Steven Schveighoffer wrote: [...] Great, thanks for you help Steve, I'll have a think about how I want to structure things. Jordan

Re: Making an .exe that executes source file inside itself.

2018-04-25 Thread BoQsc via Digitalmars-d-learn
On Wednesday, 25 April 2018 at 19:43:31 UTC, Jonathan M Davis wrote: On Wednesday, April 25, 2018 19:19:58 BoQsc via Digitalmars-d-learn wrote: So there has been idea I've got for around few months now: making a software which executable would contain a source file. A software that anyone

Re: Making an .exe that executes source file inside itself.

2018-04-25 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, April 25, 2018 19:19:58 BoQsc via Digitalmars-d-learn wrote: > So there has been idea I've got for around few months now: making > a software which executable would contain a source file. > A software that anyone could modify by opening an executable and > quickly change a few lines

Re: Get files from directory sorted by name

2018-04-25 Thread Jesse Phillips via Digitalmars-d-learn
On Wednesday, 25 April 2018 at 17:34:41 UTC, Dr.No wrote: Is there something implemented already to get the files from directory by name using D or I'm on my own and I have to write it myself? I didn't find how do that with dirEntries() I want to add that sorting can be done, if you just call

Making an .exe that executes source file inside itself.

2018-04-25 Thread BoQsc via Digitalmars-d-learn
So there has been idea I've got for around few months now: making a software which executable would contain a source file. A software that anyone could modify by opening an executable and quickly change a few lines of it, rerun an executable, see the changes. Could this be easily possible

Re: Get files from directory sorted by name

2018-04-25 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, April 25, 2018 17:34:41 Dr.No via Digitalmars-d-learn wrote: > Is there something implemented already to get the files from > directory by name using D or I'm on my own and I have to write it > myself? I didn't find how do that with dirEntries() There is nothing in the standard

Get files from directory sorted by name

2018-04-25 Thread Dr.No via Digitalmars-d-learn
Is there something implemented already to get the files from directory by name using D or I'm on my own and I have to write it myself? I didn't find how do that with dirEntries()

Re: Using an external Assembler with D

2018-04-25 Thread Stefan Koch via Digitalmars-d-learn
On Tuesday, 24 April 2018 at 21:02:07 UTC, solidstate1991 wrote: In order to make one of my own code more readable (and hopefully to avoid a lot of compiling errors under LDC, which don't happen in DMD for some reason), I'm planning to put my assembly functions into separate files for each

Re: Are Fibers just broken in D?

2018-04-25 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/24/18 10:12 PM, bitwise wrote: On Friday, 20 April 2018 at 18:58:36 UTC, Byron Moxie wrote: [...] In WIN32 it looks like its leaking memory Unless there is something I'm misunderstanding, it seems that Fibers that were not run to completion won't unroll their stack, which would mean

Re: Sense check: construction / deconstruction

2018-04-25 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/25/18 5:51 AM, Jordan Wilson wrote: On Tuesday, 24 April 2018 at 23:49:14 UTC, Steven Schveighoffer wrote: In the second case (b), you aren't including the db by value, so no destructor is called from the GC. But this is dangerous, because db stops existing after main exits, but b

Re: Implicit Template Parameters Cannot Decipher Aliases?

2018-04-25 Thread Simen Kjærås via Digitalmars-d-learn
On Wednesday, 25 April 2018 at 11:26:40 UTC, Vijay Nayar wrote: On Wednesday, 25 April 2018 at 10:25:11 UTC, Simen Kjærås wrote: In the general case, the issue is unsolvable, since the relationship between template parameters and alias results may be arbitrarily complex. A simple degenerate

Re: Implicit Template Parameters Cannot Decipher Aliases?

2018-04-25 Thread ag0aep6g via Digitalmars-d-learn
On 04/25/2018 12:25 PM, Simen Kjærås wrote: It's a known issue, and could be solved in some cases by partial template expansion, which is currently not part of the language. I believe it's in bugzilla somewhere, but a cursory search yielded no results.

Re: Warning on self assignment

2018-04-25 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, April 25, 2018 02:32:32 Per Nordlöw via Digitalmars-d-learn wrote: > On Wednesday, 25 April 2018 at 02:23:04 UTC, Mike Franklin wrote: > > Are people using self assignment of structs as a way of > > force-running the postblit? Is there a valid use case for that? > > > > Mike > > If

Re: Implicit Template Parameters Cannot Decipher Aliases?

2018-04-25 Thread Vijay Nayar via Digitalmars-d-learn
On Wednesday, 25 April 2018 at 10:25:11 UTC, Simen Kjærås wrote: In the general case, the issue is unsolvable, since the relationship between template parameters and alias results may be arbitrarily complex. A simple degenerate case is this: Ok, wow, you weren't kidding. That becomes really

Re: Warning on self assignment

2018-04-25 Thread Nordlöw via Digitalmars-d-learn
On Wednesday, 25 April 2018 at 03:32:09 UTC, Meta wrote: On Wednesday, 25 April 2018 at 02:32:32 UTC, Per Nordlöw wrote: On Wednesday, 25 April 2018 at 02:23:04 UTC, Mike Franklin wrote: Are people using self assignment of structs as a way of force-running the postblit? Is there a valid use

Re: Implicit Template Parameters Cannot Decipher Aliases?

2018-04-25 Thread Simen Kjærås via Digitalmars-d-learn
On Wednesday, 25 April 2018 at 07:39:28 UTC, Vijay Nayar wrote: I have encountered a problem where whenever I attempt to use a templated function with alias that partially limits the type of the arguments, the program fails to compile. But if I avoid using an alias, the same function can

Re: Sense check: construction / deconstruction

2018-04-25 Thread Jordan Wilson via Digitalmars-d-learn
On Tuesday, 24 April 2018 at 23:49:14 UTC, Steven Schveighoffer wrote: What you are missing is that Database is pass-by-value, not a class. So when you include it directly in a class like you did in A, then when A's destructor is called, db's destructor is called. Since in the first case, a

Re: Implicit Template Parameters Cannot Decipher Aliases?

2018-04-25 Thread Vijay Nayar via Digitalmars-d-learn
On Wednesday, 25 April 2018 at 07:39:28 UTC, Vijay Nayar wrote: addAllWithAlias(v1); // Error! One more note, this following line works correctly. addAllWithAlias!double(v1); // OK.

Implicit Template Parameters Cannot Decipher Aliases?

2018-04-25 Thread Vijay Nayar via Digitalmars-d-learn
I have encountered a problem where whenever I attempt to use a templated function with alias that partially limits the type of the arguments, the program fails to compile. But if I avoid using an alias, the same function can infer all arguments. Is this working as intended or have I

Re: Warning on self assignment

2018-04-25 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, April 25, 2018 02:23:04 Mike Franklin via Digitalmars-d-learn wrote: > On Wednesday, 25 April 2018 at 01:08:46 UTC, Arun Chandrasekaran > > wrote: > > So I was telling my colleague that D would warn on self > > assignment, but found that I was wrong. > > > >

Re: Warning on self assignment

2018-04-25 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, April 25, 2018 03:32:09 Meta via Digitalmars-d-learn wrote: > On Wednesday, 25 April 2018 at 02:32:32 UTC, Per Nordlöw wrote: > > On Wednesday, 25 April 2018 at 02:23:04 UTC, Mike Franklin > > > > wrote: > >> Are people using self assignment of structs as a way of > >> force-running