Re: Mixin operator 'if' directly

2018-12-21 Thread Michelle Long via Digitalmars-d-learn
On Saturday, 22 December 2018 at 03:44:09 UTC, Timoses wrote: On Wednesday, 19 December 2018 at 15:40:50 UTC, Neia Neutuladh wrote: On Wed, 19 Dec 2018 15:12:14 +, bauss wrote: Or while instantiating it: mixin template foo() { int _ignoreme() { if (readln.strip == "abort") throw

Re: Mixin operator 'if' directly

2018-12-21 Thread Timoses via Digitalmars-d-learn
On Wednesday, 19 December 2018 at 15:40:50 UTC, Neia Neutuladh wrote: On Wed, 19 Dec 2018 15:12:14 +, bauss wrote: Or while instantiating it: mixin template foo() { int _ignoreme() { if (readln.strip == "abort") throw new AbortException; return 1; } int _alsoIgnoreMe =

Re: Mixin operator 'if' directly

2018-12-21 Thread Michelle Long via Digitalmars-d-learn
On Thursday, 20 December 2018 at 16:23:39 UTC, H. S. Teoh wrote: On Thu, Dec 20, 2018 at 11:04:19AM +, bauss via Digitalmars-d-learn wrote: On Wednesday, 19 December 2018 at 15:40:50 UTC, Neia Neutuladh wrote: [...] > mixin template foo() > { > int _ignoreme() > { > if

Re: How to reuse the space of RAM of an array of strings?

2018-12-21 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/21/18 3:41 PM, Giovanni Di Maria wrote: Hi. Can you help me please? I asked also to "General Group" but i haven't solved my problem. I have tried many experiments but without success. I have a dynamic array of strings: string[] vec; After to have inserted dynamically 5_000_000 strings to

Re: Some Fundamental Paradigm Questions

2018-12-21 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Dec 21, 2018 at 09:26:28PM +, Dennis via Digitalmars-d-learn wrote: > The most fundamental problem that these features tackle is that code > is costly, so making code-bases smaller and more reusable saves effort > spent on maintaining large code-bases and rewriting code to suit a >

Re: How to reuse the space of RAM of an array of strings?

2018-12-21 Thread Giovanni Di Maria via Digitalmars-d-learn
On Friday, 21 December 2018 at 21:28:14 UTC, H. S. Teoh wrote: [...] Thank you very much for your replay. I will meditate about your words. Thank you Giovanni

Re: Some Fundamental Paradigm Questions

2018-12-21 Thread Dennis via Digitalmars-d-learn
The most fundamental problem that these features tackle is that code is costly, so making code-bases smaller and more reusable saves effort spent on maintaining large code-bases and rewriting code to suit a different situation. On Friday, 21 December 2018 at 12:39:48 UTC, Ron Tarrant wrote:

Re: How to reuse the space of RAM of an array of strings?

2018-12-21 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Dec 21, 2018 at 08:41:10PM +, Giovanni Di Maria via Digitalmars-d-learn wrote: [...] > After to have inserted dynamically 5_000_000 strings to array, for six > times, i measure the RAM with an utility (for example Wise Memory > Optimizer), deleting the array every time. > > Every

How to reuse the space of RAM of an array of strings?

2018-12-21 Thread Giovanni Di Maria via Digitalmars-d-learn
Hi. Can you help me please? I asked also to "General Group" but i haven't solved my problem. I have tried many experiments but without success. I have a dynamic array of strings: string[] vec; After to have inserted dynamically 5_000_000 strings to array, for six times, i measure the RAM with

Re: D1 question: does anyone has bud (build) tool available for download?

2018-12-21 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/21/18 8:25 AM, jicman wrote: There used to be a tool called 'build', later named 'bud', that would build applications.  Does anyone know where I can download it?  I tried the old spot, dsource, http://www.dsource.org/projects/build but the links for download are not working.  Any help

Re: D1 question: does anyone has bud (build) tool available for download?

2018-12-21 Thread bauss via Digitalmars-d-learn
On Friday, 21 December 2018 at 13:25:17 UTC, jicman wrote: There used to be a tool called 'build', later named 'bud', that would build applications. Does anyone know where I can download it? I tried the old spot, dsource, http://www.dsource.org/projects/build but the links for download are

Re: using dub to compile plugins

2018-12-21 Thread Neia Neutuladh via Digitalmars-d-learn
On Fri, 21 Dec 2018 10:56:39 +, Atila Neves wrote: > I don't see how you can do this with dub, and I wouldn't attempt it > either. Just use make, and have make call dub for the main project (and > potentially any plugins that need it). Remember to make the dub targets > `.PHONY` since you

Defining a class toHash() that include the typeinfo

2018-12-21 Thread Per Nordlöw via Digitalmars-d-learn
What's the preferred way of defining a `toHash()` for a concrete class that includes the TypeInfo [1] in the hash? Is it ok to hash only the address of the typeinfo pointer, assuming it's statically allocated? [1] https://dlang.org/library/object/type_info.html

D1 question: does anyone has bud (build) tool available for download?

2018-12-21 Thread jicman via Digitalmars-d-learn
There used to be a tool called 'build', later named 'bud', that would build applications. Does anyone know where I can download it? I tried the old spot, dsource, http://www.dsource.org/projects/build but the links for download are not working. Any help would be greatly appreciated.

Some Fundamental Paradigm Questions

2018-12-21 Thread Ron Tarrant via Digitalmars-d-learn
Reading through an abstract of what makes the D language tick, I found terms like mixins and templates, concepts I haven't run across in the other languages I've learned. I have a basic understanding of WHAT mixins and templates are, but what I don't understand is WHY they're part of the

Re: using dub to compile plugins

2018-12-21 Thread Atila Neves via Digitalmars-d-learn
On Wednesday, 19 December 2018 at 12:57:14 UTC, Codifies wrote: I am currently using this dub.sdl name"runz80" targetType "executable" lflags "libz80/libz80.a" however I will be creating a number of plugins, each plugin will consist of a single source file, I'd like the plugin