OS minimum version

2015-09-21 Thread ponce via Digitalmars-d-learn
1. What is the minimum Windows version required by programs created with DMD? 2. What is the minimum Windows version required by programs created with LDC? 3. What is the minimum OS X version required by programs created with LDC? You would believe such information would be easy to find,

Re: OS minimum version

2015-09-21 Thread Jack Stouffer via Digitalmars-d-learn
On Monday, 21 September 2015 at 12:47:39 UTC, ponce wrote: 3. What is the minimum OS X version required by programs created with LDC? Tiger x86 version, I believe.

Cameleon: Stricter Alternative Implementation of VariantN

2015-09-21 Thread Nordlöw via Digitalmars-d-learn
Because I'm not satisfied with the current state of memory-layout-flexibility/pureness/safeness/nogc/nothrow-ness of `VariantN` I've hacked together a lightweight version of `VariantN`, I currently call `Cameleon`. The code is here: https://github.com/nordlow/justd/blob/master/cameleon.d

Re: foreach automoatic counter?

2015-09-21 Thread cym13 via Digitalmars-d-learn
On Monday, 21 September 2015 at 22:24:22 UTC, French Football wrote: On Monday, 21 September 2015 at 19:23:38 UTC, cym13 wrote: On Monday, 21 September 2015 at 16:32:25 UTC, French Football wrote: [...] I had to look into phobos sources (/usr/include/dlang/dmd/std/containers/dlist.d) to

Re: Building basic gtkd,opengl application

2015-09-21 Thread Michał via Digitalmars-d-learn
It turns out it was caused by a bug in the gtkd. Thanks to Mike Wey already fixed. My minimal working code if somebody was intrested.

Re: foreach automoatic counter?

2015-09-21 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, September 21, 2015 15:38:38 French Football via Digitalmars-d-learn wrote: > Going through a book on coding in D, > http://ddili.org/ders/d.en/foreach.html , I find the following > very useful feature: > > When two names are specified in the names section [with a plain > array], they

Can't seem to alias BinaryHeap and use heapify

2015-09-21 Thread Enjoys Math via Digitalmars-d-learn
I've got: alias ProgramResultsQueue(O,I) = BinaryHeap!(Array!(Results!(O,I)), compareResults); outside the class ProgramOptimizer. Inside the class I have: ProgramResultsQueue!(O,I) programResultsQ = heapify!(compareResults, Array!(Results!(O,I)))(Array!(Results!(O,I)), 0); at class

Re: OS minimum version

2015-09-21 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, September 21, 2015 20:47:09 anonymous via Digitalmars-d-learn wrote: > On Monday 21 September 2015 14:47, ponce wrote: > > > 1. What is the minimum Windows version required by programs > > created with DMD? > > http://dlang.org/dmd-windows.html says: "Windows XP or later, 32 or 64 bit".

Re: Can't seem to alias BinaryHeap and use heapify

2015-09-21 Thread Ali Çehreli via Digitalmars-d-learn
It is much more efficient if you can show the problem in minimal code. :) Here is minimal code that demonstrates the problem: import std.container; struct Results(O, I) {} bool compareResults(O, I)(Results!(O, I) lhs, Results!(O, I) rhs) { return lhs == rhs; } alias

Re: Why are static arrays not ranges?

2015-09-21 Thread jmh530 via Digitalmars-d-learn
On Monday, 21 September 2015 at 20:33:10 UTC, Jack Stouffer wrote: That's ridiculous. Do I have to wrap my static arrays in structs to get range primitives? Is there an actual reason for this? I had done basically the same thing. Below is my naive implementation. import std.traits;

Re: Why are static arrays not ranges?

2015-09-21 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, September 21, 2015 20:46:51 Jack Stouffer via Digitalmars-d-learn wrote: > On Monday, 21 September 2015 at 20:39:55 UTC, Jesse Phillips > wrote: > > A static array has a constant length, so it is not possible to > > popFront on a static array. > > > > Making a dynamic array from it is

Re: foreach automoatic counter?

2015-09-21 Thread French Football via Digitalmars-d-learn
On Monday, 21 September 2015 at 19:23:38 UTC, cym13 wrote: On Monday, 21 September 2015 at 16:32:25 UTC, French Football wrote: [...] I had to look into phobos sources (/usr/include/dlang/dmd/std/containers/dlist.d) to find a unittest, and judging from it it seems inserting in the middle

Re: foreach automoatic counter?

2015-09-21 Thread Justin Whear via Digitalmars-d-learn
On Mon, 21 Sep 2015 15:38:38 +, French Football wrote: > Going through a book on coding in D, > http://ddili.org/ders/d.en/foreach.html , I find the following very > useful feature: > > When two names are specified in the names section [with a plain array], > they represent an automatic

foreach automoatic counter?

2015-09-21 Thread French Football via Digitalmars-d-learn
Going through a book on coding in D, http://ddili.org/ders/d.en/foreach.html , I find the following very useful feature: When two names are specified in the names section [with a plain array], they represent an automatic counter and the value of the element, respectively: foreach (i,

Re: foreach automoatic counter?

2015-09-21 Thread cym13 via Digitalmars-d-learn
On Monday, 21 September 2015 at 15:38:40 UTC, French Football wrote: Going through a book on coding in D, http://ddili.org/ders/d.en/foreach.html , I find the following very useful feature: When two names are specified in the names section [with a plain array], they represent an automatic

Do users need to install VS runtime redistributable if linking with Microsoft linker?

2015-09-21 Thread ponce via Digitalmars-d-learn
All in the title. DMD 64-bit links with the VS linker. Do users need to install the VS redistributable libraries?

Re: Building basic gtkd,opengl application

2015-09-21 Thread Michał via Digitalmars-d-learn
So no idea how to make basic gtk/opengl application working?

Re: Building basic gtkd,opengl application

2015-09-21 Thread Michał via Digitalmars-d-learn
On Monday, 21 September 2015 at 18:07:27 UTC, Ali Çehreli wrote: Does that work? Yes and clear output there. I have tried some basic examples of gtkd and they seems to work. GLArea has some problems.

Re: Building basic gtkd,opengl application

2015-09-21 Thread Ali Çehreli via Digitalmars-d-learn
On 09/21/2015 10:59 AM, Michał wrote: So no idea how to make basic gtk/opengl application working? With no experience at all, copying an example without opengl from a basic and incomplete Turkish gtkd tutorial[1]: import gtk.Window; import gtk.Main; int main(string[] args) {

Re: Building basic gtkd,opengl application

2015-09-21 Thread Michał via Digitalmars-d-learn
On Monday, 21 September 2015 at 18:08:15 UTC, bachmeier wrote: On Monday, 21 September 2015 at 17:59:17 UTC, Michał wrote: So no idea how to make basic gtk/opengl application working? The project has its own forum if you haven't already posted there: http://forum.gtkd.org/ I didn't. I will

Re: Building basic gtkd,opengl application

2015-09-21 Thread bachmeier via Digitalmars-d-learn
On Monday, 21 September 2015 at 17:59:17 UTC, Michał wrote: So no idea how to make basic gtk/opengl application working? The project has its own forum if you haven't already posted there: http://forum.gtkd.org/

Re: foreach automoatic counter?

2015-09-21 Thread French Football via Digitalmars-d-learn
On Monday, 21 September 2015 at 15:54:06 UTC, Justin Whear wrote: On Monday, 21 September 2015 at 15:58:12 UTC, cym13 wrote: Thankyou! .enumerate lets me iterate over a container with a counter. --Related tangential question... If I have a DList, how do I insert into the middle of it?

Re: Tried release build got ICE, does anyone have a clue what might cause this?

2015-09-21 Thread Kagamin via Digitalmars-d-learn
On Friday, 18 September 2015 at 22:54:43 UTC, Random D user wrote: I get: tym = x1d Internal error: backend\cgxmm.c 547 Does anyone have a clue what might trigger this? https://issues.dlang.org/show_bug.cgi?id=7951 https://issues.dlang.org/show_bug.cgi?id=12377 On Saturday, 19 September

Re: tkd not linking

2015-09-21 Thread karabuta via Digitalmars-d-learn
On Tuesday, 15 September 2015 at 17:46:42 UTC, Adam D. Ruppe wrote: On Tuesday, 15 September 2015 at 17:37:40 UTC, karabuta wrote: Just incase, I have install version 8.6 of the Tcl/Tk libraries Did you get the development version? sudo apt-get install tk-dev or possibly sudo apt-get

Re: Why are static arrays not ranges?

2015-09-21 Thread cym13 via Digitalmars-d-learn
On Monday, 21 September 2015 at 20:33:10 UTC, Jack Stouffer wrote: import std.range; void main() { int[6] a = [1, 2, 3, 4, 5, 6]; pragma(msg, isInputRange!(typeof(a))); pragma(msg, isForwardRange!(typeof(a))); pragma(msg, isRandomAccessRange!(typeof(a))); } $ dmd -run test.d

Why are static arrays not ranges?

2015-09-21 Thread Jack Stouffer via Digitalmars-d-learn
import std.range; void main() { int[6] a = [1, 2, 3, 4, 5, 6]; pragma(msg, isInputRange!(typeof(a))); pragma(msg, isForwardRange!(typeof(a))); pragma(msg, isRandomAccessRange!(typeof(a))); } $ dmd -run test.d false false false That's ridiculous. Do I have to wrap my static

Re: Why are static arrays not ranges?

2015-09-21 Thread Jesse Phillips via Digitalmars-d-learn
On Monday, 21 September 2015 at 20:33:10 UTC, Jack Stouffer wrote: import std.range; void main() { int[6] a = [1, 2, 3, 4, 5, 6]; pragma(msg, isInputRange!(typeof(a))); pragma(msg, isForwardRange!(typeof(a))); pragma(msg, isRandomAccessRange!(typeof(a))); } $ dmd -run test.d

Re: Why are static arrays not ranges?

2015-09-21 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 21 September 2015 at 20:33:10 UTC, Jack Stouffer wrote: pragma(msg, isInputRange!(typeof(a))); try: pragma(msg, isInputRange!(typeof(a[]))); Notice the addition of the [] after the a. That's the slicing operator and it will yield a range. Is there an actual reason for

Re: Why are static arrays not ranges?

2015-09-21 Thread anonymous via Digitalmars-d-learn
On Monday 21 September 2015 22:33, Jack Stouffer wrote: > import std.range; > > void main() { > int[6] a = [1, 2, 3, 4, 5, 6]; > > pragma(msg, isInputRange!(typeof(a))); > pragma(msg, isForwardRange!(typeof(a))); > pragma(msg, isRandomAccessRange!(typeof(a))); > } > > $ dmd

Re: Why are static arrays not ranges?

2015-09-21 Thread Jack Stouffer via Digitalmars-d-learn
On Monday, 21 September 2015 at 20:39:55 UTC, Jesse Phillips wrote: A static array has a constant length, so it is not possible to popFront on a static array. Making a dynamic array from it is easy, just slice it with []: pragma(msg, isInputRange!(typeof(a[]))); pragma(msg,

Re: foreach automoatic counter?

2015-09-21 Thread cym13 via Digitalmars-d-learn
On Monday, 21 September 2015 at 16:32:25 UTC, French Football wrote: On Monday, 21 September 2015 at 15:54:06 UTC, Justin Whear wrote: On Monday, 21 September 2015 at 15:58:12 UTC, cym13 wrote: Thankyou! .enumerate lets me iterate over a container with a counter. --Related tangential

Re: OS minimum version

2015-09-21 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-09-21 14:47, ponce wrote: 1. What is the minimum Windows version required by programs created with DMD? 2. What is the minimum Windows version required by programs created with LDC? I'm guessing Windows XP for both LDC and DMD. Windows is pretty good at backwards compatibility. 3.

Re: OS minimum version

2015-09-21 Thread anonymous via Digitalmars-d-learn
On Monday 21 September 2015 14:47, ponce wrote: > 1. What is the minimum Windows version required by programs > created with DMD? http://dlang.org/dmd-windows.html says: "Windows XP or later, 32 or 64 bit".

Re: OS minimum version

2015-09-21 Thread ponce via Digitalmars-d-learn
On Monday, 21 September 2015 at 18:47:10 UTC, anonymous wrote: On Monday 21 September 2015 14:47, ponce wrote: 1. What is the minimum Windows version required by programs created with DMD? http://dlang.org/dmd-windows.html says: "Windows XP or later, 32 or 64 bit". Thanks to all.