Re: Using closure causes GC allocation

2017-09-03 Thread Vino.B via Digitalmars-d-learn
On Saturday, 2 September 2017 at 20:54:03 UTC, Vino.B wrote: On Saturday, 2 September 2017 at 20:10:58 UTC, Moritz Maxeiner wrote: On Saturday, 2 September 2017 at 18:59:30 UTC, Vino.B wrote: [...] Cannot reproduce under Linux with dmd 2.076.0 (with commented out Windows-only check). I'll tr

Re: Crazy compile time errors with DMD 2.075.1 & 2.076.0

2017-09-03 Thread Joel via Digitalmars-d-learn
On Monday, 4 September 2017 at 04:45:27 UTC, Jonathan M Davis wrote: On Sunday, September 03, 2017 21:22:14 Ali Çehreli via Digitalmars-d-learn wrote: [...] Much as some people have been doing it for some reason, I really don't understand why anyone would be unzipping the .zip file on top of

Re: Crazy compile time errors with DMD 2.075.1 & 2.076.0

2017-09-03 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, September 03, 2017 21:22:14 Ali Çehreli via Digitalmars-d-learn wrote: > On 09/03/2017 09:03 PM, Joel wrote: > > One of my small programs doesn't compile any more since, said, DMD > > versions. > > > > I've got other programs that do work, but I can't see what's different > > about

Re: 24-bit int

2017-09-03 Thread Ilya via Digitalmars-d-learn
On Sunday, 3 September 2017 at 23:30:43 UTC, EntangledQuanta wrote: On Sunday, 3 September 2017 at 04:01:34 UTC, Ilya Yaroshenko wrote: On Saturday, 2 September 2017 at 03:29:20 UTC, EntangledQuanta wrote: On Saturday, 2 September 2017 at 02:49:41 UTC, Ilya Yaroshenko wrote: [...] Thanks. Se

Re: Crazy compile time errors with DMD 2.075.1 & 2.076.0

2017-09-03 Thread Ali Çehreli via Digitalmars-d-learn
On 09/03/2017 09:03 PM, Joel wrote: > One of my small programs doesn't compile any more since, said, DMD > versions. > > I've got other programs that do work, but I can't see what's different > about them?! > > I'm using macOS. > > [1] Here is the program and stuff. It uses DSFML 2.1.1, but I have

Crazy compile time errors with DMD 2.075.1 & 2.076.0

2017-09-03 Thread Joel via Digitalmars-d-learn
One of my small programs doesn't compile any more since, said, DMD versions. I've got other programs that do work, but I can't see what's different about them?! I'm using macOS. [1] Here is the program and stuff. It uses DSFML 2.1.1, but I haven't added the dynamic files for it. giver ~ma

Re: Bug in D!!!

2017-09-03 Thread Moritz Maxeiner via Digitalmars-d-learn
On Monday, 4 September 2017 at 03:08:50 UTC, EntangledQuanta wrote: On Monday, 4 September 2017 at 01:50:48 UTC, Moritz Maxeiner wrote: On Sunday, 3 September 2017 at 23:25:47 UTC, EntangledQuanta wrote: On Sunday, 3 September 2017 at 11:48:38 UTC, Moritz Maxeiner wrote: On Sunday, 3 September

New programming paradigm

2017-09-03 Thread EntangledQuanta via Digitalmars-d-learn
In coming up with a solution that maps enums to templates, I think it might provide a means to allow template like behavior at runtime. That is, type information is contained with in the enum which then can, with the use of compile time templates, be treated as dynamic behaviors. Let me expla

Re: Bug in D!!!

2017-09-03 Thread EntangledQuanta via Digitalmars-d-learn
On Monday, 4 September 2017 at 01:50:48 UTC, Moritz Maxeiner wrote: On Sunday, 3 September 2017 at 23:25:47 UTC, EntangledQuanta wrote: On Sunday, 3 September 2017 at 11:48:38 UTC, Moritz Maxeiner wrote: On Sunday, 3 September 2017 at 04:18:03 UTC, EntangledQuanta wrote: On Sunday, 3 September

Re: Bug in D!!!

2017-09-03 Thread Moritz Maxeiner via Digitalmars-d-learn
On Sunday, 3 September 2017 at 23:25:47 UTC, EntangledQuanta wrote: On Sunday, 3 September 2017 at 11:48:38 UTC, Moritz Maxeiner wrote: On Sunday, 3 September 2017 at 04:18:03 UTC, EntangledQuanta wrote: On Sunday, 3 September 2017 at 02:39:19 UTC, Moritz Maxeiner wrote: On Saturday, 2 Septembe

Re: Template substitution for function parameters

2017-09-03 Thread Biotronic via Digitalmars-d-learn
On Saturday, 2 September 2017 at 01:41:14 UTC, Nicholas Wilson wrote: On Friday, 1 September 2017 at 11:33:15 UTC, Biotronic wrote: On Friday, 1 September 2017 at 10:15:09 UTC, Nicholas Wilson wrote: So I have the following types struct DevicePointer(T) { T* ptr; } struct Buffer(T) { void

Re: 24-bit int

2017-09-03 Thread EntangledQuanta via Digitalmars-d-learn
On Sunday, 3 September 2017 at 04:01:34 UTC, Ilya Yaroshenko wrote: On Saturday, 2 September 2017 at 03:29:20 UTC, EntangledQuanta wrote: On Saturday, 2 September 2017 at 02:49:41 UTC, Ilya Yaroshenko wrote: On Friday, 1 September 2017 at 19:39:14 UTC, EntangledQuanta wrote: Is there a way to c

Re: Bug in D!!!

2017-09-03 Thread EntangledQuanta via Digitalmars-d-learn
On Sunday, 3 September 2017 at 11:48:38 UTC, Moritz Maxeiner wrote: On Sunday, 3 September 2017 at 04:18:03 UTC, EntangledQuanta wrote: On Sunday, 3 September 2017 at 02:39:19 UTC, Moritz Maxeiner wrote: On Saturday, 2 September 2017 at 23:12:35 UTC, EntangledQuanta wrote: [...] The contexts

Dub documentation with an initial ddoc file

2017-09-03 Thread Conor O'Brien via Digitalmars-d-learn
I've been trying to figure out how to generate documentation for my project using dub. I have found this link[1] which told me how I could use dub to generate docs: dub build --build=docs However, I wish to have a set of macros that are present on every documentation file, that would def

How to change the file extension of generated doc files

2017-09-03 Thread Jeremy DeHaan via Digitalmars-d-learn
I can't find anywhere describing how to change the extension of the generated doc files. I've tried `-of.php`, but it still generates .html. I'm probably missing something here that's going to make me feel silly.

Re: passing member.member alias to mixin template

2017-09-03 Thread Eric_DD via Digitalmars-d-learn
Clear explanation, thanks! I think it would avoid a lot of confusion to disallow the alias f = c1.field notation and only allow the alias f = C.field notation. If necessary one could use alias f = typeof(c1).field

Re: passing member.member alias to mixin template

2017-09-03 Thread ag0aep6g via Digitalmars-d-learn
On 09/03/2017 08:54 PM, Eric_DD wrote: *** This works: struct Array { void foo() { writeln("foo"); } } mixin template arrayOperations(arrays...) { void foo() { foreach(ref a; arrays) a.foo(); } } class Thing { Array data1; Array data2; mixin arrayOperatio

passing member.member alias to mixin template

2017-09-03 Thread Eric_DD via Digitalmars-d-learn
I am running into something that seems a bit inconsistent. When I pass an alias of a member to a mixin it works, but a member to member doesn't. It seems like the alias is evaluated to the last symbol before passing it to the mixin. If that's true, is there a way to defer the evaluation? Any

Re: string to character code hex string

2017-09-03 Thread Ali Çehreli via Digitalmars-d-learn
On 09/03/2017 03:03 AM, ag0aep6g wrote: > On 09/03/2017 01:39 AM, Ali Çehreli wrote: >> If we can convert byte-by-byte, we should be able to >> convert back byte-by-byte, right? > > You weren't converting byte-by-byte. In my mind I was! :o) > Or maybe just convert everything to UTF-8 first. That

Re: Problems with std.experimental.allocator

2017-09-03 Thread Igor via Digitalmars-d-learn
On Saturday, 2 September 2017 at 11:23:00 UTC, Igor wrote: I realize these are not yet stable but I would like to know if I am doing something wrong or is it a lib bug. My first attempt was to do this: theAllocator = allocatorObject(Region!MmapAllocator(1024*MB)); If I got it right th

Re: Bug in D!!!

2017-09-03 Thread Moritz Maxeiner via Digitalmars-d-learn
On Sunday, 3 September 2017 at 04:18:03 UTC, EntangledQuanta wrote: On Sunday, 3 September 2017 at 02:39:19 UTC, Moritz Maxeiner wrote: On Saturday, 2 September 2017 at 23:12:35 UTC, EntangledQuanta wrote: [...] The contexts being independent of each other doesn't change that we would still

Re: 24-bit int

2017-09-03 Thread Patrick Schluter via Digitalmars-d-learn
On Friday, 1 September 2017 at 22:10:43 UTC, Biotronic wrote: On Friday, 1 September 2017 at 19:39:14 UTC, EntangledQuanta wrote: Is there a way to create a 24-bit int? One that for all practical purposes acts as such? This is for 24-bit stuff like audio. It would respect endianness, allow for

Re: string to character code hex string

2017-09-03 Thread ag0aep6g via Digitalmars-d-learn
On 09/03/2017 01:39 AM, Ali Çehreli wrote: Ok, I see that I made a mistake but I still don't think the conversion is one way. If we can convert byte-by-byte, we should be able to convert back byte-by-byte, right? You weren't converting byte-by-byte. You were only converting the significant by