Re: dmd.conf... again

2015-08-12 Thread Atila Neves via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 12:21:14 UTC, Rikki Cattermole wrote: On 13/08/2015 12:16 a.m., Atila Neves wrote: [...] Perhaps this small snippet from my Windows install might shred some light. Specifically the LIB property. [Environment32] LIB=%@P%\..\lib LINKCMD=%@P%\link.exe

Re: dmd.conf... again

2015-08-12 Thread wobbles via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 14:05:57 UTC, Atila Neves wrote: On Wednesday, 12 August 2015 at 13:46:24 UTC, wobbles wrote: On Wednesday, 12 August 2015 at 13:00:45 UTC, Atila Neves wrote: On Wednesday, 12 August 2015 at 12:40:49 UTC, Adam D. Ruppe wrote: [...] I downloaded the zip, added

Re: Does D have syntax for adding subscopes to classes?

2015-08-12 Thread sigod via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 15:21:28 UTC, GregoryP wrote: I'm just wondering if, or how much of the following is possible in some way in D: class Foo { int x; sub Bar { int x; int getFooX(){ return super.x; } sub FooBar { int x; int

Re: dmd.conf... again

2015-08-12 Thread Atila Neves via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 15:22:39 UTC, wobbles wrote: On Wednesday, 12 August 2015 at 14:05:57 UTC, Atila Neves wrote: On Wednesday, 12 August 2015 at 13:46:24 UTC, wobbles wrote: On Wednesday, 12 August 2015 at 13:00:45 UTC, Atila Neves wrote: On Wednesday, 12 August 2015 at 12:40:49

Re: dmd.conf... again

2015-08-12 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 15:30:09 UTC, Atila Neves wrote: I've never seen a colon in library options before and the (ancient) gcc on the system doesn't seem to like it one bit. ohhh, I have seen that before, I was on a CentOS 5 VM and it didn't like that colon either. It was added

Re: Does D have syntax for adding subscopes to classes?

2015-08-12 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 15:24:43 UTC, sigod wrote: [Nested classes][0] maybe? Example with them: class Foo { int x; class Bar_ { // underscore cuz we have to declare variable too int x; int getFooX() { return this.outer.x; }

Re: dmd.conf... again

2015-08-12 Thread via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 15:30:09 UTC, Atila Neves wrote: On Wednesday, 12 August 2015 at 15:22:39 UTC, wobbles wrote: On Wednesday, 12 August 2015 at 14:05:57 UTC, Atila Neves wrote: On Wednesday, 12 August 2015 at 13:46:24 UTC, wobbles wrote: On Wednesday, 12 August 2015 at 13:00:45

Re: dmd.conf... again

2015-08-12 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 15:49:37 UTC, Joakim Brännström wrote: From man ld :) It's only there if you have a new enough ld for the feature to be supported! One of the work CentOS VMs I have to use sometimes doesn't have it. $ ld --version GNU ld version 2.17.50.0.6-14.el5 20061020

Re: Hello Assembly!

2015-08-12 Thread Taylor Hillegeist via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 22:32:30 UTC, Adam D. Ruppe wrote: On Wednesday, 12 August 2015 at 22:18:41 UTC, Adam D. Ruppe wrote: [...] Here's an example: [...] Wow, very cool thanks!

Hello Assembly!

2015-08-12 Thread Taylor Hillegeist via Digitalmars-d-learn
So i was playing around with the D inline assembly trying to make it say hello world on my windows setup... void main(){ asm { myhello: db HELLO, WORLD$; mov EAX , myhello; mov AH, 0x09; int 0x21; } } I figure this should do it. but i'm

Re: Hello Assembly!

2015-08-12 Thread Justin Whear via Digitalmars-d-learn
On Wed, 12 Aug 2015 22:10:30 +, Taylor Hillegeist wrote: I figure this should do it. but i'm running into problems. Anybody know why? Describe problems

Re: More threads - Slower program ??

2015-08-12 Thread Yuxuan Shui via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 23:15:48 UTC, Adam D. Ruppe wrote: On Wednesday, 12 August 2015 at 23:06:32 UTC, Yuxuan Shui wrote: What is wrong here? I didn't look too closely, but there's some memory allocations going on there which have the potential of locking all the threads any time

More threads - Slower program ??

2015-08-12 Thread Yuxuan Shui via Digitalmars-d-learn
Here is a small program (https://gist.github.com/yshui/a426f73be77d1d699555) that uses taskPool to parallely reading from /proc/pid/ and sum the swap usage. Individual tasks has zero dependency between each other, but when I remove the 'defaultPoolThreads(1)' line, the programs takes 8x

Re: Hello Assembly!

2015-08-12 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 22:18:41 UTC, Adam D. Ruppe wrote: The way you'd typically do it on Windows is to just call one of the win32 api functions, similarly to how you'd do it from C or regular D, just calling the functions manually. Here's an example: import

Re: Hello Assembly!

2015-08-12 Thread Taylor Hillegeist via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 22:18:41 UTC, Adam D. Ruppe wrote: On Wednesday, 12 August 2015 at 22:10:32 UTC, Taylor Hillegeist wrote: So i was playing around with the D inline assembly trying to make it say hello world on my windows setup... Have you ever written assembly for Windows

Re: Hello Assembly!

2015-08-12 Thread Taylor Hillegeist via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 22:14:58 UTC, Justin Whear wrote: On Wed, 12 Aug 2015 22:10:30 +, Taylor Hillegeist wrote: I figure this should do it. but i'm running into problems. Anybody know why? Describe problems object.Error@(0): Access Violation 0x00402028

Re: More threads - Slower program ??

2015-08-12 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 23:06:32 UTC, Yuxuan Shui wrote: What is wrong here? I didn't look too closely, but there's some memory allocations going on there which have the potential of locking all the threads any time one of them tries to allocate. Parallelism's benefits are largely

Should these aliases kind be illegal ?

2015-08-12 Thread anonymous via Digitalmars-d-learn
The following alias declaration is totally legal but actually it's not usable --- class Foo { void something(size_t param){} } class Bar { private Foo foo; this(){foo = new Foo;} alias somethingelse = foo.something; } void main(string[] args) { auto bar = new Bar;

Re: Hello Assembly!

2015-08-12 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 22:10:32 UTC, Taylor Hillegeist wrote: So i was playing around with the D inline assembly trying to make it say hello world on my windows setup... Have you ever written assembly for Windows before? Your code looks more like DOS (aside from the EAX, which would

Re: Should these aliases kind be illegal ?

2015-08-12 Thread Timon Gehr via Digitalmars-d-learn
On 08/13/2015 12:17 AM, anonymous wrote: The following alias declaration is totally legal but actually it's not usable --- class Foo { void something(size_t param){} } class Bar { private Foo foo; this(){foo = new Foo;} alias somethingelse = foo.something; } void

Attributes not propagating to objects via typeinfo?

2015-08-12 Thread rsw0x via Digitalmars-d-learn
Sample code: class C{} struct S{} void main(){ import std.stdio; auto c = new shared C(); auto s = new shared S(); writeln(typeid(c)); //modulename.C writeln(typeid(s)); //shared(modulename.S)* writeln(typeid(c).next); //null writeln(typeid(s).next);

Indivisual Incremental Compalation with dub

2015-08-12 Thread Freddy via Digitalmars-d-learn
I have a file that takes a while to compile with a static interface. Is there any way i can make dub keep the object file of only that file(for faster compilation)?

Re: Derelict, SDL, and OpenGL3: Triangle Tribulations

2015-08-12 Thread JN via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 05:58:23 UTC, BBasile wrote: On Wednesday, 12 August 2015 at 05:46:27 UTC, Mike Parker wrote: On Wednesday, 12 August 2015 at 05:34:22 UTC, BBasile wrote: [...] It seems to me that your driver is doing things it isn't actually supposed to do. This code is

Re: Derelict, SDL, and OpenGL3: Triangle Tribulations

2015-08-12 Thread BBasile via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 05:46:27 UTC, Mike Parker wrote: On Wednesday, 12 August 2015 at 05:34:22 UTC, BBasile wrote: [...] It seems to me that your driver is doing things it isn't actually supposed to do. This code is binding a vertex buffer object with a function which is

Re: Derelict, SDL, and OpenGL3: Triangle Tribulations

2015-08-12 Thread DarthCthulhu via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 05:26:33 UTC, JN wrote: You need a vertex and a fragment shader. You can't render anything in OGL3 without shaders. I thought that was the case, but the tutorial I was looking at didn't have any shaders at that point. I added a shader program. Also, you

Re: dmd.conf... again

2015-08-12 Thread Atila Neves via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 15:49:37 UTC, Joakim Brännström wrote: On Wednesday, 12 August 2015 at 15:30:09 UTC, Atila Neves wrote: [...] From man ld :) -l namespec Add the archive or object file specified by namespec to the list of files to link. This option may be used any number of

IFTI with template alias fails in D, works in C++

2015-08-12 Thread Timothee Cour via Digitalmars-d-learn
main.d: -- struct A(T, int D) { this(string ignore){} } alias B(T)=A!(T, 1); void fun1(T)(A!(T,1) a) { } void fun2(T)(B!T a) { } unittest{ auto a=A!(double,1)(a); assert(is(typeof(a) == B!double)); fun1(a);//ok fun2!double(a);//ok // no IFTI here: //fun2(a);//not ok:

Re: dmd.conf... again

2015-08-12 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 12:16:50 UTC, Atila Neves wrote: I'm trying to use dmd on a VM where I don't have root privileges (don't ask). I can't copy dmd.conf to /etc. If you use the dmd zip, everything just works when you just unzip it and use it all in-place. No need to move or copy

Re: Convert a hex color string into r,g,b components.

2015-08-12 Thread wobbles via Digitalmars-d-learn
On Tuesday, 11 August 2015 at 22:11:51 UTC, Marcin Szymczak wrote: I would really love to solve this problem using ranges, because i am learning how to use them. Unfortunately even such a simple task seems so hard for me ;( I think writing a simple function to parse a string into a Color

Re: dmd.conf... again

2015-08-12 Thread Dicebot via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 13:04:25 UTC, Atila Neves wrote: On Wednesday, 12 August 2015 at 12:29:46 UTC, Dicebot wrote: More info about what gets placed where please. I have special dev layout on my system that co-exists with system-wide installation of dmd. It is as simple as having

Re: Code Reviewer

2015-08-12 Thread Clayton via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 02:49:59 UTC, Rikki Cattermole wrote: On 12/08/2015 10:50 a.m., Clayton wrote: Hello everyone, Am looking for someone who could help review my code . As an entry exercise to D am converting 3 C implementations of popular pattern matching algorithms. The idea

Re: Code Reviewer

2015-08-12 Thread Rikki Cattermole via Digitalmars-d-learn
On 13/08/2015 12:09 a.m., Clayton wrote: On Wednesday, 12 August 2015 at 02:49:59 UTC, Rikki Cattermole wrote: On 12/08/2015 10:50 a.m., Clayton wrote: Hello everyone, Am looking for someone who could help review my code . As an entry exercise to D am converting 3 C implementations of

dmd.conf... again

2015-08-12 Thread Atila Neves via Digitalmars-d-learn
I'm trying to use dmd on a VM where I don't have root privileges (don't ask). I can't copy dmd.conf to /etc. According to the docs, I should be able to use a dmd.conf that's in the same dir as dmd itself, or in my home directory, or even specifying -conf=. None of these seems to tell dmd where

Re: dmd.conf... again

2015-08-12 Thread via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 12:16:50 UTC, Atila Neves wrote: I'm trying to use dmd on a VM where I don't have root privileges (don't ask). I can't copy dmd.conf to /etc. According to the docs, I should be able to use a dmd.conf that's in the same dir as dmd itself, or in my home directory,

Re: dmd.conf... again

2015-08-12 Thread Rikki Cattermole via Digitalmars-d-learn
On 13/08/2015 12:16 a.m., Atila Neves wrote: I'm trying to use dmd on a VM where I don't have root privileges (don't ask). I can't copy dmd.conf to /etc. According to the docs, I should be able to use a dmd.conf that's in the same dir as dmd itself, or in my home directory, or even specifying

Re: dmd.conf... again

2015-08-12 Thread Dicebot via Digitalmars-d-learn
More info about what gets placed where please. I have special dev layout on my system that co-exists with system-wide installation of dmd. It is as simple as having ~/dlang/{dmd|druntime|phobos}, linking ~/dlang/dmd/src/dmd to ~/bin/dmd-dev and placing dmd.conf in ~/bin which adds all those

Re: dmd.conf... again

2015-08-12 Thread Atila Neves via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 12:29:46 UTC, Dicebot wrote: More info about what gets placed where please. I have special dev layout on my system that co-exists with system-wide installation of dmd. It is as simple as having ~/dlang/{dmd|druntime|phobos}, linking ~/dlang/dmd/src/dmd to

Re: dmd.conf... again

2015-08-12 Thread Atila Neves via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 12:40:49 UTC, Adam D. Ruppe wrote: On Wednesday, 12 August 2015 at 12:16:50 UTC, Atila Neves wrote: I'm trying to use dmd on a VM where I don't have root privileges (don't ask). I can't copy dmd.conf to /etc. If you use the dmd zip, everything just works when

Re: Code Reviewer

2015-08-12 Thread sigod via Digitalmars-d-learn
On Tuesday, 11 August 2015 at 22:50:52 UTC, Clayton wrote: Hello everyone, Am looking for someone who could help review my code . As an entry exercise to D am converting 3 C implementations of popular pattern matching algorithms. The idea is to have 6 final implementations ( 3 compile-time

Re: dmd.conf... again

2015-08-12 Thread Atila Neves via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 13:46:24 UTC, wobbles wrote: On Wednesday, 12 August 2015 at 13:00:45 UTC, Atila Neves wrote: On Wednesday, 12 August 2015 at 12:40:49 UTC, Adam D. Ruppe wrote: On Wednesday, 12 August 2015 at 12:16:50 UTC, Atila Neves wrote: [...] If you use the dmd zip,

Re: dmd.conf... again

2015-08-12 Thread wobbles via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 13:00:45 UTC, Atila Neves wrote: On Wednesday, 12 August 2015 at 12:40:49 UTC, Adam D. Ruppe wrote: On Wednesday, 12 August 2015 at 12:16:50 UTC, Atila Neves wrote: I'm trying to use dmd on a VM where I don't have root privileges (don't ask). I can't copy

tharsis.prof tests are broken with dmd 2.068

2015-08-12 Thread extrawurst via Digitalmars-d-learn
Hi guys, i am having no luck to fix the bug causing kiith-sa project tharsis.prof to successfully build with unittests: https://github.com/kiith-sa/tharsis.prof/issues/2 the actual compiler error says: ``` C:\_apps\D\dmd2\windows\bin\..\..\src\phobos\std\range\package.d(7180,24): Error:

Re: Does D have syntax for adding subscopes to classes?

2015-08-12 Thread Xinok via Digitalmars-d-learn
On Wednesday, 12 August 2015 at 15:47:37 UTC, Adam D. Ruppe wrote: Example with them: ... That's the idea I had except I would use a struct instead because using a class requires a second allocation.

Re: dmd.conf... again

2015-08-12 Thread Ali Çehreli via Digitalmars-d-learn
On 08/12/2015 08:38 AM, Adam D. Ruppe wrote: On Wednesday, 12 August 2015 at 15:30:09 UTC, Atila Neves wrote: I've never seen a colon in library options before and the (ancient) gcc on the system doesn't seem to like it one bit. ohhh, I have seen that before, I was on a CentOS 5 VM and it