Re: Base class with member parameterized on type of extending class

2014-10-19 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-10-19 13:19, rcor wrote: I'm trying to make a game, and would like to set up the following hierarchy: At any time, the game is in one Scene. Each scene has a state machine that manages States of type T, where T is the type of the scene (e.g. Overworld, Menu). abstract class State!T {

Re: How to convert from ubyte[] to and from float?

2014-10-19 Thread uri via Digitalmars-d-learn
On Sunday, 19 October 2014 at 03:14:26 UTC, Charles Hixson via Digitalmars-d-learn wrote: What is the best way to convert from a part of a ubyte[] to a float? I've tried converting the ubyte[] into a uint, but neither casting the uint to a float nor to!float work. I suppose I could use a "tr

Re: Benchmark games, Rust, big ints and Pi

2014-10-19 Thread John Carter via Digitalmars-d-learn
On Monday, 10 February 2014 at 22:19:19 UTC, bearophile wrote: http://dpaste.dzfl.pl/821527e71343 Your paste has expired / no longer there but the subject has come up again... http://www.wilfred.me.uk/blog/2014/10/20/the-fastest-bigint-in-the-west/ https://lobste.rs/s/sfie8j/the_fastes

Re: DDoc module description?

2014-10-19 Thread Jeremy DeHaan via Digitalmars-d-learn
On Sunday, 19 October 2014 at 18:19:26 UTC, Gary Willoughby wrote: On Sunday, 19 October 2014 at 17:43:51 UTC, Jeremy DeHaan wrote: That's ok though. I can live with out it. I'll look through the bugzilla site and see if I can find a bug report for this or open up a new one. On a side note, i

Re: [OT] the uses of computing

2014-10-19 Thread ketmar via Digitalmars-d-learn
On Sun, 19 Oct 2014 23:34:17 + Joakim via Digitalmars-d-learn wrote: > The desktop UI paradigm needs to be completely redone, from the > ground up. Current desktop GUIs are too limiting and the > terminal is powerful but antiquated. The problem is how best to > combine the two, since one

Re: [OT] the uses of computing

2014-10-19 Thread Joakim via Digitalmars-d-learn
On Sunday, 19 October 2014 at 04:55:55 UTC, ketmar via Digitalmars-d-learn wrote: On Sat, 18 Oct 2014 23:38:35 + Joakim via Digitalmars-d-learn wrote: don't you think that we are going in circles now? not that i'm tired of this conversation, but i see that we get each other's POVs, and

Making plugin system with shared libraries. Upcast in shared lib

2014-10-19 Thread MrSmith via Digitalmars-d-learn
I'm using Windows. I was making some sort of modular system where you can define modules that are loaded by host application. Here is a simple example https://gist.github.com/MrSmith33/7692328455a19e820a7c Now i want to separate these "modules" in separate shared libs and link them on the fly.

Re: "Error: Undefined identifier" when moving import to another module

2014-10-19 Thread Joakim via Digitalmars-d-learn
On Sunday, 19 October 2014 at 09:39:05 UTC, nrgyzer wrote: Hi guys, when I do the following: module myMain; import example; import std.traits; import my.static.library.binding; static this() { foreach ( m; __traits(allMembers, example) ) { static if ( isCallable!(mixing(m) )

Re: Really in need of help with std.container.array.d

2014-10-19 Thread Nordlöw
On Sunday, 19 October 2014 at 20:39:18 UTC, anonymous wrote: array.d(234,13): Error: mutable method std.container.array.Array!int.Array.opAssign is not callable using a const object You didn't make the change we just discussed. Change line 234 from `_outer = data;` to `_outer_ = data;`. You

Re: D developing on ARM board

2014-10-19 Thread Joakim via Digitalmars-d-learn
On Sunday, 19 October 2014 at 14:35:06 UTC, Suliman wrote: I am planing to buy ARM-Board. I would use it for internet browsing and whant to know would it's possible to develop D apps on it? Which ARM board do you plan on getting? I own a Pandaboard ES. I tried using it for browsing for some

Re: Really in need of help with std.container.array.d

2014-10-19 Thread anonymous via Digitalmars-d-learn
On Sunday, 19 October 2014 at 15:21:02 UTC, anonymous wrote: struct RefCounted { this(this) /* const doesn't help */ {} ~this() /* const doesn't help */ {} } struct Array { RefCounted _data; } void main() {const Array a; const copy = a;} /* works */ struct RangeM {Array a;} /*

Re: Really in need of help with std.container.array.d

2014-10-19 Thread anonymous via Digitalmars-d-learn
On Sunday, 19 October 2014 at 20:39:18 UTC, anonymous wrote: Spell the type out or use `typeof(result)`. Should be `typeof(return)`.

Re: Really in need of help with std.container.array.d

2014-10-19 Thread anonymous via Digitalmars-d-learn
On Sunday, 19 October 2014 at 20:10:33 UTC, Nordlöw wrote: Used your ideas here https://github.com/nordlow/phobos/commit/be6b5f8c4d428a9708a52757a3f31aab6878d379 but unittests now fails as array.d(234,13): Error: mutable method std.container.array.Array!int.Array.opAssign is not callable usi

Re: Really in need of help with std.container.array.d

2014-10-19 Thread Nordlöw
On Sunday, 19 October 2014 at 19:36:46 UTC, anonymous wrote: On Sunday, 19 October 2014 at 19:30:40 UTC, Nordlöw wrote: On Sunday, 19 October 2014 at 19:13:33 UTC, anonymous wrote: Yes, they don't compile. It's three slightly different versions of initializing _outer. The first one, `_outer =

Re: Really in need of help with std.container.array.d

2014-10-19 Thread anonymous via Digitalmars-d-learn
On Sunday, 19 October 2014 at 19:30:40 UTC, Nordlöw wrote: On Sunday, 19 October 2014 at 19:13:33 UTC, anonymous wrote: Yes, they don't compile. It's three slightly different versions of initializing _outer. The first one, `_outer = data;`, is the original one. It's understandable that it doesn

Re: Really in need of help with std.container.array.d

2014-10-19 Thread Nordlöw
On Sunday, 19 October 2014 at 19:13:33 UTC, anonymous wrote: Yes, they don't compile. It's three slightly different versions of initializing _outer. The first one, `_outer = data;`, is the original one. It's understandable that it doesn't work anymore with the workaround in place. I don't know

Re: Really in need of help with std.container.array.d

2014-10-19 Thread anonymous via Digitalmars-d-learn
On Sunday, 19 October 2014 at 18:58:50 UTC, Nordlöw wrote: On Sunday, 19 October 2014 at 15:21:02 UTC, anonymous wrote: version(none) _outer = data; /* "Error: mutable method [...].Array.opAssign is not callable using a const object" */ What do these comments conta

Re: Really in need of help with std.container.array.d

2014-10-19 Thread Nordlöw
On Sunday, 19 October 2014 at 15:21:02 UTC, anonymous wrote: version(none) _outer = data; /* "Error: mutable method [...].Array.opAssign is not callable using a const object" */ What do these comments containing Error messages mean? Doesn't this code compile?

Re: "Error: Undefined identifier" when moving import to another module

2014-10-19 Thread nrgyzer via Digitalmars-d-learn
On Sunday, 19 October 2014 at 17:14:14 UTC, monarch_dodra wrote: On Sunday, 19 October 2014 at 16:09:41 UTC, nrgyzer wrote: "mixing" should be replaced with "mixin": static if ( isCallable!(mixin(m) ) My main is empty in both cases. So nothing done in my main (currently). Posting full code

Re: DDoc module description?

2014-10-19 Thread Gary Willoughby via Digitalmars-d-learn
On Sunday, 19 October 2014 at 17:43:51 UTC, Jeremy DeHaan wrote: That's ok though. I can live with out it. I'll look through the bugzilla site and see if I can find a bug report for this or open up a new one. On a side note, is there any way that I can redefine the DDOC macro (or any other ma

Re: DDoc module description?

2014-10-19 Thread Jeremy DeHaan via Digitalmars-d-learn
That's ok though. I can live with out it. I'll look through the bugzilla site and see if I can find a bug report for this or open up a new one. On a side note, is there any way that I can redefine the DDOC macro (or any other macro) once and have it be used for every file? That was the only t

Re: DDoc module description?

2014-10-19 Thread Jeremy DeHaan via Digitalmars-d-learn
On Sunday, 19 October 2014 at 16:59:10 UTC, Gary Willoughby wrote: On Sunday, 19 October 2014 at 16:44:25 UTC, Jeremy DeHaan wrote: The problem seems to be when I do something like this. *blah.d* ///A module that contains blahblahblah. module something.blah; //Stuff goes here What will end u

Re: "Error: Undefined identifier" when moving import to another module

2014-10-19 Thread monarch_dodra via Digitalmars-d-learn
On Sunday, 19 October 2014 at 16:09:41 UTC, nrgyzer wrote: "mixing" should be replaced with "mixin": static if ( isCallable!(mixin(m) ) My main is empty in both cases. So nothing done in my main (currently). Posting full code that actually compiles and reproduces the issue helps.

Re: m_condition.mutex cannot be used in shared method ?

2014-10-19 Thread Sean Kelly via Digitalmars-d-learn
On Sunday, 19 October 2014 at 13:42:05 UTC, Marco Leise wrote: I have a thread that is shared by others, so I have a shared method, inside of which I wrote: final void opOpAssign(string op : "~")(ref StreamingObject item) shared { synchronized (m_condition.mutex) {

Re: DDoc module description?

2014-10-19 Thread Gary Willoughby via Digitalmars-d-learn
On Sunday, 19 October 2014 at 16:44:25 UTC, Jeremy DeHaan wrote: The problem seems to be when I do something like this. *blah.d* ///A module that contains blahblahblah. module something.blah; //Stuff goes here What will end up happening is the generated html file turns out like this:

Re: DDoc module description?

2014-10-19 Thread Jeremy DeHaan via Digitalmars-d-learn
Thanks for the reply. I just went through it and I didn't see anything that was missed. I'll post this here so that maybe someone can see something I am missing. DDOC = href="stylesheets/stylesheet.css"> $(TITLE) https://github.com/Jebbs/DSFML";>View on GitHub DSFML

Re: "Error: Undefined identifier" when moving import to another module

2014-10-19 Thread nrgyzer via Digitalmars-d-learn
On Sunday, 19 October 2014 at 14:48:18 UTC, monarch_dodra wrote: On Sunday, 19 October 2014 at 09:39:05 UTC, nrgyzer wrote: Hi guys, when I do the following: static if ( isCallable!(mixing(m) ) "mixing" ? void main() { /* do something here */ } What exactly are you doing here? ...

Re: Really in need of help with std.container.array.d

2014-10-19 Thread anonymous via Digitalmars-d-learn
On Wednesday, 15 October 2014 at 21:15:14 UTC, Nordlöw wrote: https://github.com/nordlow/phobos/commit/9daf235d7091f76cd941e29e3c167d559bf56a94 but that triggers a new interesting suite of errors Error: mutable method std.container.array.Array!int.Array.__fieldPostBlit is not callable using a

Re: "Error: Undefined identifier" when moving import to another module

2014-10-19 Thread monarch_dodra via Digitalmars-d-learn
On Sunday, 19 October 2014 at 09:39:05 UTC, nrgyzer wrote: Hi guys, when I do the following: static if ( isCallable!(mixing(m) ) "mixing" ? void main() { /* do something here */ } What exactly are you doing here? ... I'm getting many error messages like these: myMain.d-mixin-11(11

D developing on ARM board

2014-10-19 Thread Suliman via Digitalmars-d-learn
I am planing to buy ARM-Board. I would use it for internet browsing and whant to know would it's possible to develop D apps on it? I had read that LDC have limited support of ARM. wiki said that it can compile hello-world apps. But it it not enough. What about DMD. Is there any progress of A

m_condition.mutex cannot be used in shared method ?

2014-10-19 Thread Marco Leise via Digitalmars-d-learn
I have a thread that is shared by others, so I have a shared method, inside of which I wrote: final void opOpAssign(string op : "~")(ref StreamingObject item) shared { synchronized (m_condition.mutex) { m_list.unshared ~= item; m_condition.notify();

Re: Runtime execution

2014-10-19 Thread Mjkp via Digitalmars-d-learn
On Sunday, 19 October 2014 at 06:55:18 UTC, Bauss wrote: Is there anyway to pull of a runtime compilation of D code or at the very least asm execution? You can call dmd using std.process to compile a D plug-in edited in your D program and dynamic link the output .dll or .so just after the dmd

Base class with member parameterized on type of extending class

2014-10-19 Thread rcor via Digitalmars-d-learn
I'm trying to make a game, and would like to set up the following hierarchy: At any time, the game is in one Scene. Each scene has a state machine that manages States of type T, where T is the type of the scene (e.g. Overworld, Menu). abstract class State!T { void update(T scene, float time,

Re: DDoc module description?

2014-10-19 Thread Gary Willoughby via Digitalmars-d-learn
On Sunday, 19 October 2014 at 01:11:39 UTC, Jeremy DeHaan wrote: Although perhaps unnecessary, I added DDoc documentation to my module for a short description of the body. This showed up in the place I wanted it to be in when I built the html documentation, so I was pretty happy. (below the mod

"Error: Undefined identifier" when moving import to another module

2014-10-19 Thread nrgyzer via Digitalmars-d-learn
Hi guys, when I do the following: module myMain; import example; import std.traits; import my.static.library.binding; static this() { foreach ( m; __traits(allMembers, example) ) { static if ( isCallable!(mixing(m) ) { // ... do something here } } } void ma

Re: Runtime execution

2014-10-19 Thread Marco Leise via Digitalmars-d-learn
Am Sun, 19 Oct 2014 06:55:17 + schrieb "Bauss" : > Is there anyway to pull of a runtime compilation of D code or at > the very least asm execution? Sure. For runtime compilation you invoke any installed D compiler and compile a conventional shared library that you then load with: http://dlan

Runtime execution

2014-10-19 Thread Bauss via Digitalmars-d-learn
Is there anyway to pull of a runtime compilation of D code or at the very least asm execution?