Re: How to create dynamically sized objects

2016-09-29 Thread Nicholas Wilson via Digitalmars-d-learn
On Thursday, 29 September 2016 at 07:10:44 UTC, Straivers wrote: Hi, Say I wanted to create an object that has a string member, and I want the string to be allocated with the object contiguously instead of as a pointer to another location (as a constructor would do). For example: class C {

Re: Reinstalled Mac

2016-09-29 Thread Paolo Invernizzi via Digitalmars-d-learn
On Thursday, 29 September 2016 at 11:43:32 UTC, Jacob Carlborg wrote: Cool, what if I want to use different versions in different sessions, i.e. I have two tabs open in my terminal? Ummm... All the installed stuff is pretty well organised inside `/usr/local`, so this works... --- hw0062:~

Re: Reinstalled Mac

2016-09-29 Thread Guillaume Piolat via Digitalmars-d-learn
On Thursday, 29 September 2016 at 06:24:08 UTC, Jacob Carlborg wrote: On 2016-09-29 03:43, David Nadlinger wrote: Jacob is also the author of DVM, so he might be a bit biased. ;) And you would never recommend LDC? ;) More or less related: it would be nice if DVM supports LDC fetching and

Re: Learning ddoc

2016-09-29 Thread Antonio Corbi via Digitalmars-d-learn
On Thursday, 29 September 2016 at 11:50:26 UTC, bachmeier wrote: On Thursday, 29 September 2016 at 09:35:56 UTC, Antonio Corbi wrote: [...] They used https://github.com/economicmodeling/harbored Thanks! that's it. Antonio

Re: Learning ddoc

2016-09-29 Thread bachmeier via Digitalmars-d-learn
On Thursday, 29 September 2016 at 09:35:56 UTC, Antonio Corbi wrote: Hi, I'm in the process of learning how ddoc works. I've successfully created docs for my code and recently learned how to generate it using dub. Related to this and after seeing the announcement of the new release of the em

Re: Learning ddoc

2016-09-29 Thread Jacob Carlborg via Digitalmars-d-learn
On 2016-09-29 11:35, Antonio Corbi wrote: Hi, I'm in the process of learning how ddoc works. I've successfully created docs for my code and recently learned how to generate it using dub. Related to this and after seeing the announcement of the new release of the emsi-containers library, I had a

Re: Reinstalled Mac

2016-09-29 Thread Jacob Carlborg via Digitalmars-d-learn
On 2016-09-29 10:29, Paolo Invernizzi wrote: It seems simple: --- hw0062:~ pinver$ brew info dmd dmd: stable 2.071.2 (bottled), HEAD D programming language compiler for OS X https://dlang.org/ /usr/local/Cellar/dmd/2.071.0_1 (561 files, 65.0M) Poured from bottle on 2016-06-23 at 14:51:10 /usr

Re: Proper way to work around `Invalid memory operation`?

2016-09-29 Thread Kagamin via Digitalmars-d-learn
On Sunday, 25 September 2016 at 16:07:12 UTC, Matthias Klumpp wrote: Hello! I have a class similar to this one: ``` class Dummy { private: string tmpDir; public: this (string fname) { tmpDir = buildPath ("/tmp", fname.baseName); std.file.mkdirRecurse (tmpDir);

Re: How to debug (potential) GC bugs?

2016-09-29 Thread Kagamin via Digitalmars-d-learn
Does it crash only in rt_finalize2? It calls the class destructor, and the destructor must not allocate or touch GC in any way because the GC doesn't yet support allocation during collection.

struct to json/yaml/xml/whatever codegen

2016-09-29 Thread Daniel N via Digitalmars-d-learn
Is anyone aware of a tool which does something akin to the following: Given a C-like definition, automatically generate pure C code with no dependencies. Input c-struct: struct Person { int id; char* name; } Output minimal c-code: void dumpPerson(Person* p) { prin

Learning ddoc

2016-09-29 Thread Antonio Corbi via Digitalmars-d-learn
Hi, I'm in the process of learning how ddoc works. I've successfully created docs for my code and recently learned how to generate it using dub. Related to this and after seeing the announcement of the new release of the emsi-containers library, I had a look at its docs (http://economicmodel

Re: Reinstalled Mac

2016-09-29 Thread Paolo Invernizzi via Digitalmars-d-learn
On Thursday, 29 September 2016 at 06:24:08 UTC, Jacob Carlborg wrote: On 2016-09-29 03:43, David Nadlinger wrote: I've had good experiences using Homebrew, although you sometimes have to wait a day or three for a new release to appear. — David DVM doesn't have that problem :). How easy is it

Re: How to create dynamically sized objects

2016-09-29 Thread Straivers via Digitalmars-d-learn
Actually, would just passing the parameters and an allocator do it? You'd just need to allocate the string in the constructor, right?

How to create dynamically sized objects

2016-09-29 Thread Straivers via Digitalmars-d-learn
Hi, Say I wanted to create an object that has a string member, and I want the string to be allocated with the object contiguously instead of as a pointer to another location (as a constructor would do). For example: class C { this(int i, string s) { this.i = i; this.s = s