Re: interface is interface

2014-06-18 Thread rumbu via Digitalmars-d-learn
On Tuesday, 17 June 2014 at 19:02:34 UTC, Pavel wrote: class A : B, C { override void test() {} override void test1() {} } If you swap the interfaces (class A: C, B), a is b will return false, but a is c will return true. Clearly, this is a bug. void main() { A a = new A();

Re: DMD Fails with fPIC error

2014-06-18 Thread Reuben via Digitalmars-d-learn
On Sunday, 15 June 2014 at 09:08:10 UTC, Mike Wey wrote: On 06/14/2014 06:37 PM, Reuben wrote: It looks like the only difference is which version of Phobos we link. I think the reason for this might be that since my version of gcc is hardened, it uses -fPIE by default for linking.

Re: DLLs with Cygwin don't work

2014-06-18 Thread Chris via Digitalmars-d-learn
On Tuesday, 17 June 2014 at 09:51:06 UTC, Chris wrote: The following: 1. created test C-dll in Cygwin (gcc -shared -o hello.dll hello.o) 2. used implib.exe /s to create .lib file 3. linked with D program dmd test.d hello.lib Compiles, program starts but begins to hang as soon as it calls

Re: Working on a library: request for code review

2014-06-18 Thread via Digitalmars-d-learn
On Tuesday, 17 June 2014 at 18:35:34 UTC, Mike wrote: Thanks, will work on fixes tonight. The current method will not detect an error when the image type is not mapped but a color map is present. At least I assume that is not a valid TGA file? A non-mapped image may contain a color map ;-0

Re: C++'s defaulted comparison operators proposal

2014-06-18 Thread Artur Skawina via Digitalmars-d-learn
On 06/18/14 07:49, Ali Çehreli via Digitalmars-d-learn wrote: The idea is to be able to have standard comparison behavior for structs without boilerplate. For example, if the ordering should consider all members of the following struct one after the other (first 'i', then 'l', and finally

Concurrency on Windows (spawn)

2014-06-18 Thread Chris via Digitalmars-d-learn
Windows: in a D-DLL I'm trying to spawn a thread. However, nothing happens auto myThread = spawn(myFunction, thisTid); send(myThread, arg); The thread is never called. Any ideas? Thanks! PS In an old DLL it used to work, there I called it with only one argument, i.e. spawn(myFunction). Is

Re: C++'s defaulted comparison operators proposal

2014-06-18 Thread Ellery Newcomer via Digitalmars-d-learn
On Wednesday, 18 June 2014 at 05:49:30 UTC, Ali Çehreli wrote: Can you come up with a D library solution to the following C++11 proposal: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2014/n3950.html did this years ago (or something similar, at least):

Re: Working on a library: request for code review

2014-06-18 Thread Rene Zwanenburg via Digitalmars-d-learn
On Wednesday, 18 June 2014 at 13:42:32 UTC, Rene Zwanenburg wrote: On Wednesday, 18 June 2014 at 09:41:01 UTC, Marc Schütz wrote: On Tuesday, 17 June 2014 at 18:35:34 UTC, Mike wrote: Thanks, will work on fixes tonight. The current method will not detect an error when the image type is not

Re: Working on a library: request for code review

2014-06-18 Thread Rene Zwanenburg via Digitalmars-d-learn
On Monday, 16 June 2014 at 23:04:33 UTC, Rene Zwanenburg wrote: The writeCompressed function can probably be simplified using std.algorithm but it's not straightforward. I'll need to ponder it for a while. Here's a version using std.algorithm and std.range. I think it's easier to understand

Re: Concurrency on Windows (spawn)

2014-06-18 Thread Kapps via Digitalmars-d-learn
On Wednesday, 18 June 2014 at 15:03:55 UTC, Ali Çehreli wrote: On 06/18/2014 06:28 AM, Chris wrote: On Wednesday, 18 June 2014 at 11:57:06 UTC, Chris wrote: Windows: in a D-DLL I'm trying to spawn a thread. However, nothing happens auto myThread = spawn(myFunction, thisTid); send(myThread,

Re: D1: UTF8 char[] casting to wchar[] array cast misalignment ERROR

2014-06-18 Thread jicman via Digitalmars-d-learn
On Wednesday, 18 June 2014 at 02:25:34 UTC, Jesse Phillips wrote: On Tuesday, 17 June 2014 at 02:27:43 UTC, jicman wrote: Greetings! I have a bunch of files plain ASCII, UTF8 and UTF16 with and without BOM (Byte Order Mark). I had, I thought, a nice way of figuring out what type of

Some kind of RPC exists for D?

2014-06-18 Thread Bienlein via Digitalmars-d-learn
Hello, I'm looking for a way to do some kind of RPC in D. Some way of being able to say aFoo.bar(int i, ...) with receiver object and method being marshalled at the sender's site and being unmarshalled and invoked at the receiver's site. Any hints appreciated. Thanks, Bienlein

Re: Some kind of RPC exists for D?

2014-06-18 Thread David Nadlinger via Digitalmars-d-learn
On Wednesday, 18 June 2014 at 19:24:03 UTC, Bienlein wrote: I'm looking for a way to do some kind of RPC in D. Some way of being able to say aFoo.bar(int i, ...) with receiver object and method being marshalled at the sender's site and being unmarshalled and invoked at the receiver's site. Any

Run child process with null stdin/stdout

2014-06-18 Thread David Nadlinger via Digitalmars-d-learn
Hi all, is there a platform independent way to do the equivalent of some_program /dev/null /dev/null using std.process? I neither want to capture/print the standard output of the child process nor have anything available on its input. Quite probably, I'm just missing something obvious…

Re: Run child process with null stdin/stdout

2014-06-18 Thread Justin Whear via Digitalmars-d-learn
On Wed, 18 Jun 2014 19:37:58 +, David Nadlinger wrote: Hi all, is there a platform independent way to do the equivalent of some_program /dev/null /dev/null using std.process? I neither want to capture/print the standard output of the child process nor have anything available on its

Re: Run child process with null stdin/stdout

2014-06-18 Thread David Nadlinger via Digitalmars-d-learn
On Wednesday, 18 June 2014 at 20:00:43 UTC, Justin Whear wrote: For POSIX, seems like you could pass `File(/dev/null, r)` for stdin and `File(/dev/null, w)`. On Windows I believe you can use `File (nul)` for the same effect. Implementing this myself is of course always an option, yes, but

'!' and naming conventions

2014-06-18 Thread cym13 via Digitalmars-d-learn
Hello, I see a lot of functions and other stuff with a '!' in the name such as 'bitfields!' or 'ctRegex!'. What does it mean exactly? In scheme, we use such a convention to warn that a function is not pure, but I don't see the point of using it that way in D as there are other way to express it.

How to I call D code from C# Project?

2014-06-18 Thread GoD via Digitalmars-d-learn
Hi. I want use my D code in C# How can I do this? D, very fast programming language. But I can not WinForm applications from D. I'm using C# for WinForm applications. But, also i want to use D code for my project. for example; I'm see PC information with D lang. Example Code(Suppose that

Re: '!' and naming conventions

2014-06-18 Thread w0rp via Digitalmars-d-learn
On Wednesday, 18 June 2014 at 20:55:36 UTC, cym13 wrote: Hello, I see a lot of functions and other stuff with a '!' in the name such as 'bitfields!' or 'ctRegex!'. What does it mean exactly? In scheme, we use such a convention to warn that a function is not pure, but I don't see the point of

DMD assert error

2014-06-18 Thread Byron Heads via Digitalmars-d-learn
Anyone seeing this error? Assertion failure: '0' on line 423 in file 'backend\aa.c' DMD 2.065 win8 -Byron

Re: DMD assert error

2014-06-18 Thread bearophile via Digitalmars-d-learn
Byron Heads: Anyone seeing this error? Assertion failure: '0' on line 423 in file 'backend\aa.c' Please put in a new Bugzilla entry a minimal program that generates that failure. Bye, bearophile

Re: '!' and naming conventions

2014-06-18 Thread Gary Willoughby via Digitalmars-d-learn
On Wednesday, 18 June 2014 at 20:55:36 UTC, cym13 wrote: Hello, I see a lot of functions and other stuff with a '!' in the name such as 'bitfields!' or 'ctRegex!'. What does it mean exactly? I think this will be helpful: http://nomad.so/2013/07/templates-in-d-explained/

Re: '!' and naming conventions

2014-06-18 Thread Jonathan M Davis via Digitalmars-d-learn
Sent: Wednesday, June 18, 2014 at 11:02 PM From: Brad Anderson via Digitalmars-d-learn digitalmars-d-learn@puremagic.com To: digitalmars-d-learn@puremagic.com Subject: Re: '!' and naming conventions There is a style guide on the website: http://dlang.org/dstyle.html Personally I just

Re: '!' and naming conventions

2014-06-18 Thread Brad Anderson via Digitalmars-d-learn
On Wednesday, 18 June 2014 at 21:58:48 UTC, Jonathan M Davis via Digitalmars-d-learn wrote: Sent: Wednesday, June 18, 2014 at 11:02 PM From: Brad Anderson via Digitalmars-d-learn digitalmars-d-learn@puremagic.com To: digitalmars-d-learn@puremagic.com Subject: Re: '!' and naming conventions

Re: How to I call D code from C# Project?

2014-06-18 Thread Jesse Phillips via Digitalmars-d-learn
On Wednesday, 18 June 2014 at 20:55:09 UTC, GoD wrote: Hi. I want use my D code in C# How can I do this? My plan was to use COM. I've not actually implemented such communication. Juno provides some items: https://github.com/JesseKPhillips/Juno-Windows-Class-Library/ But I haven't done

Re: How to I call D code from C# Project?

2014-06-18 Thread GoD via Digitalmars-d-learn
@Jesse How to use in C# projects?

String cast error

2014-06-18 Thread SomeRiz via Digitalmars-d-learn
Hi. My code running: http://dpaste.dzfl.pl/2183586524df Output: SerialNumber 927160020 (X = Some Numbers) How do I delete SerialNumber text? Example string SomeRiz = system(a); I get an error: b.d(10): Error: cannot implicitly convert expression (system(a)) of type int to string

Re: String cast error

2014-06-18 Thread Justin Whear via Digitalmars-d-learn
On Thu, 19 Jun 2014 00:05:36 +, SomeRiz wrote: Hi. My code running: http://dpaste.dzfl.pl/2183586524df Output: SerialNumber 927160020 (X = Some Numbers) How do I delete SerialNumber text? Example string SomeRiz = system(a); I get an error: b.d(10): Error:

Re: String cast error

2014-06-18 Thread SomeRiz via Digitalmars-d-learn
Hi Justin thank you. I'm using executeShell(a); Output: ProcessOutput(0, SerialNumber\r\r\n92716002 \r\r\n\r\r\n) How do I delete ProcessOutPut, 0, SerialNumber, \r,\n text? I want to see just out: 92716002 Sorry for my bad english :(

Re: String cast error

2014-06-18 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Jun 19, 2014 at 12:31:51AM +, SomeRiz via Digitalmars-d-learn wrote: Hi Justin thank you. I'm using executeShell(a); Output: ProcessOutput(0, SerialNumber\r\r\n92716002 \r\r\n\r\r\n) How do I delete ProcessOutPut, 0, SerialNumber, \r,\n text? I want to see

Re: String cast error

2014-06-18 Thread SomeRiz via Digitalmars-d-learn
Thanks Teoh I'm trying compile but i get an error: b.d(22): Error: function b.extractSerial (string input) is not callable using ar gument types (ProcessOutput)

Re: String cast error

2014-06-18 Thread Ali Çehreli via Digitalmars-d-learn
On 06/18/2014 06:04 PM, SomeRiz wrote: Thanks Teoh I'm trying compile but i get an error: b.d(22): Error: function b.extractSerial (string input) is not callable using ar gument types (ProcessOutput) According to its documentation, executeShell() returns a Tuple consisting of the return

Re: Doing exercise from book, but I'm getting error with splitter

2014-06-18 Thread sigod via Digitalmars-d-learn
On Monday, 16 June 2014 at 16:49:46 UTC, Andrew Brown wrote: ulong[string] dictionary; // the length property is ulong, not uint Actually length is size_t (uint on x86 and ulong on x64).

Re: String cast error

2014-06-18 Thread SomeRiz via Digitalmars-d-learn
@Ali Çehreli Thanks I'm test code :) Successfully :) Thank you :)

Re: How to I call D code from C# Project?

2014-06-18 Thread Jesse Phillips via Digitalmars-d-learn
On Wednesday, 18 June 2014 at 23:41:43 UTC, GoD wrote: @Jesse How to use in C# projects? You'll have to access it through a COM interface on the C# side. http://msdn.microsoft.com/en-us/library/aa645736%28v=vs.71%29.aspx If you haven't done work in COM before its a lot of new things to

Re: Some kind of RPC exists for D?

2014-06-18 Thread Rikki Cattermole via Digitalmars-d-learn
On 19/06/2014 7:24 a.m., Bienlein wrote: Hello, I'm looking for a way to do some kind of RPC in D. Some way of being able to say aFoo.bar(int i, ...) with receiver object and method being marshalled at the sender's site and being unmarshalled and invoked at the receiver's site. Any hints

how can I ensure that a template instantiation is unique?

2014-06-18 Thread Vlad Levenfeld via Digitalmars-d-learn
I'm instantiating a couple of template structs that conflict with each other. I'd like them to be unique types, automatically. So I tried this: template Foo (string unique_id = __FILE__~__LINE__.to!string) {...} but it didn't work. When I use this for templated functions, I get the file and