Re: Getting the current module as a symbol

2016-04-12 Thread Vladimir Panteleev via Digitalmars-d-learn
On Tuesday, 12 April 2016 at 13:44:07 UTC, Mithun Hunsur wrote: Hi all, I'm looking for the equivalent of `typeof(this)` in module scope (so that it gets the current module). My use-case is iterating over the members of the module - right now I'm doing `mixin(iterateOverModule!(module.name.h

Re: Getting the current module as a symbol

2016-04-12 Thread Mithun Hunsur via Digitalmars-d-learn
On Tuesday, 12 April 2016 at 14:22:22 UTC, Adam D. Ruppe wrote: On Tuesday, 12 April 2016 at 13:44:07 UTC, Mithun Hunsur wrote: I'm looking for the equivalent of `typeof(this)` in module scope (so that it gets the current module). The trick I use is `mixin(__MODULE__)`. I also mentioned this

Re: Need help with bytea data type from PostgreSQL.

2016-04-12 Thread Garrick via Digitalmars-d-learn
On Tuesday, 12 April 2016 at 13:01:12 UTC, Suliman wrote: With: x = row[0].as!(ubyte[]); I am getting error: core.exception.AssertError@C:\D\dmd2\windows\bin\..\..\src\phobos\std\typecons.d(1920): Called `get' on null Nullable!ubyte[]. I'm the author of the specific dpq library you're using.

Re: Dynamic library

2016-04-12 Thread Chris via Digitalmars-d-learn
On Tuesday, 12 April 2016 at 10:11:27 UTC, Russel Winder wrote: On Mon, 2016-04-11 at 14:15 +, Chris via Digitalmars-d-learn wrote: I wanted to test, if I could use D with JNA (Java Native Access). I get this error message: # A fatal error has been detected by the Java Runtime Environment

Re: Why is Linux the only OS in version identifier list that has a lowercase name?

2016-04-12 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, April 12, 2016 19:15:33 Joseph Rushton Wakeling via Digitalmars-d- learn wrote: > On Tuesday, 12 April 2016 at 18:23:25 UTC, Jonathan M Davis wrote: > > Well, work has been done to make it so that different runtimes > > will work - e.g. there's a CRuntime_Glibc and a CRuntime_Bionic. >

Re: DWT Cloning / Build fails

2016-04-12 Thread Jacob Carlborg via Digitalmars-d-learn
On 2016-04-12 17:32, Chris wrote: This doesn't work: $ git clone --recursive git://github.com/d-widget-toolkit/dwt.git $ git clone --recursive https://github.com/d-widget-toolkit/dwt.git (cf. https://github.com/d-widget-toolkit/dwt) What errors to you get? This should work unless you have a

Re: Why is Linux the only OS in version identifier list that has a lowercase name?

2016-04-12 Thread Joseph Rushton Wakeling via Digitalmars-d-learn
On Tuesday, 12 April 2016 at 18:23:25 UTC, Jonathan M Davis wrote: Well, work has been done to make it so that different runtimes will work - e.g. there's a CRuntime_Glibc and a CRuntime_Bionic. That's pretty cool. Was that a result of the recent Android porting work, or was it a longer-stand

Re: Why is Linux the only OS in version identifier list that has a lowercase name?

2016-04-12 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, April 12, 2016 17:22:05 Joseph Rushton Wakeling via Digitalmars-d- learn wrote: > On Tuesday, 12 April 2016 at 01:32:02 UTC, Brian Schott wrote: > > On Monday, 11 April 2016 at 23:01:08 UTC, marcpmichel wrote: > >> Is it because Linux is not an OS ? :p > > > > I gnu somebody would bring

Re: djvm fails to build

2016-04-12 Thread Chris via Digitalmars-d-learn
On Tuesday, 12 April 2016 at 15:54:10 UTC, rikki cattermole wrote: I'll look into it tomorrow, but I suspect I'm gonna need to do some serious work to get it work with the new import rules. Also maybe best to take this to gitter[0] or github issue so that I get an alert. [0] https://gitter.i

Re: Why is Linux the only OS in version identifier list that has a lowercase name?

2016-04-12 Thread Joseph Rushton Wakeling via Digitalmars-d-learn
On Tuesday, 12 April 2016 at 01:32:02 UTC, Brian Schott wrote: On Monday, 11 April 2016 at 23:01:08 UTC, marcpmichel wrote: Is it because Linux is not an OS ? :p I gnu somebody would bring that up. There's actually a serious point here, though -- as D is ported to other platforms and archit

Re: djvm fails to build

2016-04-12 Thread rikki cattermole via Digitalmars-d-learn
I'll look into it tomorrow, but I suspect I'm gonna need to do some serious work to get it work with the new import rules. Also maybe best to take this to gitter[0] or github issue so that I get an alert. [0] https://gitter.im/rikkimax/chatWithMe

DWT Cloning / Build fails

2016-04-12 Thread Chris via Digitalmars-d-learn
This doesn't work: $ git clone --recursive git://github.com/d-widget-toolkit/dwt.git $ git clone --recursive https://github.com/d-widget-toolkit/dwt.git (cf. https://github.com/d-widget-toolkit/dwt) If I just download the master or clone without `--recursive`, files are missing and I cannot

Re: Passing _arguments into another variadic function

2016-04-12 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 12 April 2016 at 09:08:06 UTC, Satoshi wrote: Is it possible to pass varargs to another function or must I do it by asm? In C, you would make a version of the function that takes the va_list type (see, for example, vprintf). I believe in D, you'd want to do the same thing. Make

Re: Getting the current module as a symbol

2016-04-12 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 12 April 2016 at 13:44:07 UTC, Mithun Hunsur wrote: I'm looking for the equivalent of `typeof(this)` in module scope (so that it gets the current module). The trick I use is `mixin(__MODULE__)`. I also mentioned this in my book https://www.packtpub.com/application-development/d-co

djvm fails to build

2016-04-12 Thread Chris via Digitalmars-d-learn
@Rikki I can't get djvm to build (dmd 2.069.1 and higher) https://github.com/rikkimax/djvm [Error Message] Performing "debug" build using dmd for x86_64. djvm ~master: building configuration "library"... String (Constructor!string, Constructor!(), Method!(char, "charAt", int), Method!(string,

Getting the current module as a symbol

2016-04-12 Thread Mithun Hunsur via Digitalmars-d-learn
Hi all, I'm looking for the equivalent of `typeof(this)` in module scope (so that it gets the current module). My use-case is iterating over the members of the module - right now I'm doing `mixin(iterateOverModule!(module.name.here));` but in the interests of keeping the code simple to maint

Re: Dub and derelict-allegro5 "Could not find a valid dependency tree configuration"

2016-04-12 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 12 April 2016 at 09:19:14 UTC, Pedro Lopes wrote: I changed the dub.sdl dependency to version 0.0.5, but dub cant recognize that version: "Root package allegrotest contains reference to invalid package derelict-allegro5 0.0.5" My fault. I forgot to 'git push --tags'. Once the du

Re: Need help with bytea data type from PostgreSQL.

2016-04-12 Thread Suliman via Digitalmars-d-learn
With: x = row[0].as!(ubyte[]); I am getting error: core.exception.AssertError@C:\D\dmd2\windows\bin\..\..\src\phobos\std\typecons.d(1920): Called `get' on null Nullable!ubyte[].

Re: Passing _arguments into another variadic function

2016-04-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/12/16 5:08 AM, Satoshi wrote: Hello, I have a little problem with Variadic functions. I have function like: void perform(string method, ...) { // here I want to call method findMethod with _argptr and _arguments } MethodDesc findMethod(string method, ...) { // some lookup through the tab

Re: Why is Linux the only OS in version identifier list that has a lowercase name?

2016-04-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/10/16 9:19 PM, Zekereth wrote: On Monday, 11 April 2016 at 01:15:27 UTC, Ali Çehreli wrote: As a workaround, you can set version to Linux yourself: version (linux) { version = Linux; } void main() { version (Linux) { import std.stdio; writeln("Linux worked!");

Re: Need help with bytea data type from PostgreSQL.

2016-04-12 Thread rikki cattermole via Digitalmars-d-learn
On 12/04/2016 11:48 PM, Suliman wrote: I am still trying to get work any of PostgreSQL drivers. For last few day I had test all of drivers. All of them are _very_ buggy! Just few of them have support of `bytea` data type, that use for binary blobs. But support does not mean that it's work. Now

Re: Correct way to spawn many and stoping when one finishes ?

2016-04-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/10/16 4:59 AM, klimp wrote: On Sunday, 10 April 2016 at 07:48:51 UTC, klimp wrote: Is this corrrect ? Each task searches for the same thing so when once has found the others don't need to run anymore. It looks a bit strange not to stop those who havent find the thing: Actually I have to k

Re: foreach of classes

2016-04-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/9/16 6:10 AM, Lucien wrote: Hello. When I do: - class MyClass{..} class YourClass{..} class OurClass{..} YourClass yc = new YourClass(); foreach (auto id; [ typeid(MyClass), typeid(YourClass), typeid(OurClass) ]) { if (typeid(yc) == id) { writeln("It works

Re: Dub and derelict-allegro5 "Could not find a valid dependency tree configuration"

2016-04-12 Thread Pedro Lopes via Digitalmars-d-learn
Never mind, I used version 0.0.3, now works. Thank you.

Need help with bytea data type from PostgreSQL.

2016-04-12 Thread Suliman via Digitalmars-d-learn
I am still trying to get work any of PostgreSQL drivers. For last few day I had test all of drivers. All of them are _very_ buggy! Just few of them have support of `bytea` data type, that use for binary blobs. But support does not mean that it's work. Now I am trying to get https://github.com

Re: Dynamic library

2016-04-12 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2016-04-11 at 14:15 +, Chris via Digitalmars-d-learn wrote: > I wanted to test, if I could use D with JNA (Java Native Access).  > I get this error message: > > # A fatal error has been detected by the Java Runtime Environment: > # > #  SIGSEGV (0xb) at pc=0x7fd24ab66074, pid=15733

Re: Dub and derelict-allegro5 "Could not find a valid dependency tree configuration"

2016-04-12 Thread Pedro Lopes via Digitalmars-d-learn
On Monday, 11 April 2016 at 15:51:51 UTC, Mike Parker wrote: On Monday, 11 April 2016 at 10:34:58 UTC, Pedro Lopes wrote: it is definitely derelict-allegro5's fault. Yes. As I said in my second post, change your dependency to 0.0.5 and you should be good to go. I changed the dub.sdl depe

Passing _arguments into another variadic function

2016-04-12 Thread Satoshi via Digitalmars-d-learn
Hello, I have a little problem with Variadic functions. I have function like: void perform(string method, ...) { // here I want to call method findMethod with _argptr and _arguments } MethodDesc findMethod(string method, ...) { // some lookup through the tables... } I know there are variad