Re: Implicit conversion from class in parent class fails?

2012-06-16 Thread Andrew Wiley
On Sat, Jun 16, 2012 at 11:52 AM, Namespace rswhi...@googlemail.com wrote: Why work this: [code] class Foo { } class Bar : Foo { } class Quatz : Bar { } void foo(Foo f) { } void main() {        Foo f = new Foo();        Foo f2;        foo(f);        foo(f2);        Bar b = new

Re: Windows program instant crash: no messages.

2012-06-12 Thread Andrew Wiley
On Tue, Jun 12, 2012 at 1:32 AM, Dmitry Olshansky dmitry.o...@gmail.com wrote: On 12.06.2012 11:17, Nekroze wrote: Hello. I am trying to make a wrapper to use the DarkGDK 3d game engine for windows with D and i am doing rather well so far. I have just gotten it to successfully compile however

Re: Windows program instant crash: no messages.

2012-06-12 Thread Andrew Wiley
On Tue, Jun 12, 2012 at 1:50 AM, Andrew Wiley wiley.andre...@gmail.com wrote: On Tue, Jun 12, 2012 at 1:32 AM, Dmitry Olshansky dmitry.o...@gmail.com wrote: On 12.06.2012 11:17, Nekroze wrote: Hello. I am trying to make a wrapper to use the DarkGDK 3d game engine for windows with D and i am

Re: Segmentation fault hell in D

2012-06-09 Thread Andrew Wiley
On Sat, Jun 9, 2012 at 6:09 AM, Dejan Lekic dejan.le...@gmail.com wrote: On Fri, 08 Jun 2012 19:57:47 -0700, Andrew Wiley wrote: On Fri, Jun 8, 2012 at 11:29 AM, Jonathan M Davis jmdavisp...@gmx.comwrote: On Friday, June 08, 2012 19:30:57 Jarl André jarl.an...@gmail.com@puremagic.com wrote

Re: floats default to NaN... why?

2012-06-09 Thread Andrew Wiley
On Sat, Jun 9, 2012 at 4:53 PM, Andrew Wiley wiley.andre...@gmail.com wrote: On Sat, Jun 9, 2012 at 11:57 AM, Kevin kevincox...@gmail.com wrote: On Sat 09 Jun 2012 14:59:21 EDT, Jerome BENOIT wrote: On 09/06/12 20:48, Kevin wrote: On 09/06/12 14:42, Minas wrote: With ints, the best

Re: floats default to NaN... why?

2012-06-08 Thread Andrew Wiley
On Thu, Jun 7, 2012 at 6:50 PM, Minas minas_mina1...@hotmail.co.uk wrote: I agree that the default value for floats/doubles should be zero. It feels much more natural. The point is to make sure code is correct. Initializing your variables should be what feels natural. Leaving then

Re: Segmentation fault hell in D

2012-06-08 Thread Andrew Wiley
On Fri, Jun 8, 2012 at 11:29 AM, Jonathan M Davis jmdavisp...@gmx.comwrote: On Friday, June 08, 2012 19:30:57 Jarl André jarl.an...@gmail.com@puremagic.com wrote: Evry single time I encounter them I yawn. It means using the next frickin hour to comment away code, add more log statements and

Re: convert ubyte[k..k + 1] to int

2012-05-16 Thread Andrew Wiley
On Wed, May 16, 2012 at 11:03 AM, Regan Heath re...@netmail.co.nz wrote: On Wed, 16 May 2012 15:24:33 +0100, ref2401 refacto...@gmail.com wrote: i have an array of ubytes. how can i convert two adjacent ubytes from the array to an integer? pseudocode example: ubyte[5] array =

Re: convert ubyte[k..k + 1] to int

2012-05-16 Thread Andrew Wiley
On Wed, May 16, 2012 at 11:07 PM, H. S. Teoh hst...@quickfur.ath.cx wrote: On Wed, May 16, 2012 at 10:25:51PM -0500, Andrew Wiley wrote: On Wed, May 16, 2012 at 11:03 AM, Regan Heath re...@netmail.co.nz wrote: On Wed, 16 May 2012 15:24:33 +0100, ref2401 refacto...@gmail.com wrote

Re: What is a good strategy for finding undefined symbols...

2012-05-12 Thread Andrew Wiley
On Sat, May 12, 2012 at 12:22 PM, WhatMeWorry kc_hea...@yahoo.com wrote: Looks like you are trying to link. Libraries are not linked they are just compiled. Then object files are put together into library file. Link produces *executable* (yeah I recall that was hard to get at first).

Re: std.socket with GDC

2012-02-25 Thread Andrew Wiley
On Sat, Feb 25, 2012 at 4:45 PM, DNewbie r...@myopera.com wrote: On Sat, Feb 25, 2012, at 10:38 PM, Mars wrote: On Saturday, 25 February 2012 at 18:27:29 UTC, Vladimir Panteleev wrote: On Friday, 24 February 2012 at 19:15:26 UTC, Mars wrote: Hello everybody. When trying to compile a

Re: Singleton question (shared class)

2012-01-25 Thread Andrew Wiley
On Wed, Jan 25, 2012 at 9:35 AM, Steven Schveighoffer schvei...@yahoo.com wrote: On Wed, 25 Jan 2012 09:50:57 -0500, Mars -@-.- wrote: Alternative approach, I just found: http://pastie.org/private/1jlcvfostnbopfp3quflg If I get that right, this is basically the classic singleton, like it

Re: Singleton Pattern

2012-01-05 Thread Andrew Wiley
On Thu, Jan 5, 2012 at 4:15 PM, asm a...@hotmail.com wrote: how can i implementing the singleton pattern in D? Multithreaded or not?

Re: AA char[] as key

2012-01-03 Thread Andrew Wiley
On Tue, Jan 3, 2012 at 1:25 PM, simendsjo simend...@gmail.com wrote: seems T[char[]] is rewritten as T[const(char)[]], and does not accept char[] as key even if mutable data should automatically convert to const (right..?) Shouldn't T[char[]] be disallowed, and have to be written as

Re: AA char[] as key

2012-01-03 Thread Andrew Wiley
On Tue, Jan 3, 2012 at 1:41 PM, Andrew Wiley wiley.andre...@gmail.com wrote: On Tue, Jan 3, 2012 at 1:25 PM, simendsjo simend...@gmail.com wrote: seems T[char[]] is rewritten as T[const(char)[]], and does not accept char[] as key even if mutable data should automatically convert to const (right

Re: AA char[] as key

2012-01-03 Thread Andrew Wiley
On Tue, Jan 3, 2012 at 1:50 PM, simendsjo simend...@gmail.com wrote: On 03.01.2012 20:41, Andrew Wiley wrote: On Tue, Jan 3, 2012 at 1:25 PM, simendsjosimend...@gmail.com  wrote: seems T[char[]] is rewritten as T[const(char)[]], and does not accept char[] as key even if mutable data should

Re: AA char[] as key

2012-01-03 Thread Andrew Wiley
On Tue, Jan 3, 2012 at 4:20 PM, bearophile bearophileh...@lycos.com wrote: Andrew Wiley: If the compiler is basically going to disallow using the AA as anything but a long[string], it should really disallow declaring anything with a mutable key type. Disallowing mutable keys

Re: GetAndSet function (corresponding to cas function)

2011-12-26 Thread Andrew Wiley
On Mon, Dec 26, 2011 at 2:34 PM, Adrian Mercieca amerci...@gmail.com wrote: Hi folks, Would anyone answer me on this please? To clarify, in Java there is are getAndSet methods on Atomic type objects (along with compareAndSet). I know that in D there is the cas function (equivalent to

Re: GetAndSet function (corresponding to cas function)

2011-12-26 Thread Andrew Wiley
On Mon, Dec 26, 2011 at 4:05 PM, Jonathan M Davis jmdavisp...@gmx.com wrote: On Monday, December 26, 2011 20:34:39 Adrian Mercieca wrote: Hi folks, Would anyone answer me on this please? To clarify, in Java there is are getAndSet methods on Atomic type objects (along with compareAndSet).

Re: Catching signals with D

2011-12-24 Thread Andrew Wiley
On Sat, Dec 24, 2011 at 7:37 AM, Matej Nanut matejna...@gmail.com wrote: @Heywood Floyd: that works, but what exactly am I permitted to use inside the handler, as I assume it's a C function? This might be a useless question as non-atomic operations touching global data aren't supposed to be in

Re: Reading about D: few questions

2011-12-24 Thread Andrew Wiley
2011/12/24 Mr. Anonymous mailnew4s...@gmail.com: On 24.12.2011 19:01, Denis Shelomovskij wrote: 23.12.2011 22:51, bearophile пишет: ++a[] works, but a[]++ doesn't. Already known compiler bug. Is it a joke? Array expression in D are for performance reasons to generate x2-x100 faster code

Re: Reading about D: few questions

2011-12-24 Thread Andrew Wiley
On Sat, Dec 24, 2011 at 9:50 AM, Timon Gehr timon.g...@gmx.ch wrote: On 12/24/2011 06:18 PM, Andrew Wiley wrote: 2011/12/24 Mr. Anonymousmailnew4s...@gmail.com: On 24.12.2011 19:01, Denis Shelomovskij wrote: 23.12.2011 22:51, bearophile пишет: ++a[] works, but a[]++ doesn't. Already

Re: Reading about D: few questions

2011-12-24 Thread Andrew Wiley
On Sat, Dec 24, 2011 at 1:08 PM, Timon Gehr timon.g...@gmx.ch wrote: On 12/24/2011 07:00 PM, Andrew Wiley wrote: On Sat, Dec 24, 2011 at 9:50 AM, Timon Gehrtimon.g...@gmx.ch  wrote: On 12/24/2011 06:18 PM, Andrew Wiley wrote: 2011/12/24 Mr. Anonymousmailnew4s...@gmail.com: On 24.12.2011

Re: Reading about D: few questions

2011-12-24 Thread Andrew Wiley
On Sat, Dec 24, 2011 at 1:45 PM, Timon Gehr timon.g...@gmx.ch wrote: On 12/24/2011 08:41 PM, Mr. Anonymous wrote: On 24.12.2011 21:22, Andrew Wiley wrote: On Sat, Dec 24, 2011 at 1:08 PM, Timon Gehrtimon.g...@gmx.ch wrote: On 12/24/2011 07:00 PM, Andrew Wiley wrote: On Sat, Dec 24, 2011

Re: Linking problem on Mac OS X

2011-12-24 Thread Andrew Wiley
On Sat, Dec 24, 2011 at 6:29 PM, Robert Rouse robert.e.ro...@gmail.com wrote: Running a simple compile and link dmd test.d produces gcc-4.2: Invalid argument What can I provide to track this down? Run with `dmd -v` to get the linker commandline.

Re: test if object is instance of class at compile time

2011-12-22 Thread Andrew Wiley
On Thu, Dec 22, 2011 at 8:35 AM, Trass3r u...@known.com wrote: I'd really like to have 'if (instance is ClassType)' syntax in D. It couldn't use that syntax because 'is' means direct bitwise equality everywhere else. Changing it in this one situation would be awkward.

Re: Are D classes always garbage collected?

2011-12-21 Thread Andrew Wiley
On Wed, Dec 21, 2011 at 10:20 PM, Froglegs lug...@gmail.com wrote: Which returned me a nice fat null pointer.. wth? Perhaps that should be a compile time error if you aren't supposed to use classes.. Strange... I'm not sure what the deal is with that overload. I meant the last one on the

Re: Restrict access to critical functions

2011-12-14 Thread Andrew Wiley
2011/12/12 Christian Köstlin christian.koest...@gmail.com: Hi, I want to restrict the access of a piece of d2-code to just some functions I declare allowed. E.g. I would like to forbid all access to io and prevent the program to format my hd. Or even better I would like to tell D2 which

Re: Matching with std.concurrency receive

2011-12-10 Thread Andrew Wiley
On Sat, Dec 10, 2011 at 1:38 PM, Jonathan M Davis jmdavisp...@gmx.com wrote: On Saturday, December 10, 2011 17:30:50 Adam wrote: Hrm... that's a bit problematic. If I do use the exact match, it seems to hang / lock up (probably the lack of support for classes?). However, that's pretty much

Re: Is __VERSION__ cross-compiler compatible?

2011-11-22 Thread Andrew Wiley
On Mon, Nov 21, 2011 at 8:16 PM, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: GDC does seem to use this, now that I've tested it: D:\dev\code\d_codegdc test.d 1067L D:\dev\code\d_codegdc -v2 test.d 2052L I've found the docs, it states this is a compiler token:

Re: .di files have implementation??

2011-10-22 Thread Andrew Wiley
On Sat, Oct 22, 2011 at 9:49 PM, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: It's because the function is small enough to be inlineable, you can't inline it if you've only got the prototype in the header file. So it's optimizations at play. Interestingly, it looks like GNU ld should

Re: D on other platforms than Win,Lin,Mac?

2011-09-07 Thread Andrew Wiley
On Wed, Sep 7, 2011 at 2:46 AM, Johannes Pfau s...@example.com wrote: Andrew Wiley wrote: On Tue, Sep 6, 2011 at 2:25 PM, Johannes Pfau s...@example.com wrote: Trass3r wrote: I've heard that our company is considering the T20 from Toradex.com for a new project with remote hardware

Re: D on other platforms than Win,Lin,Mac?

2011-09-06 Thread Andrew Wiley
On Tue, Sep 6, 2011 at 2:25 PM, Johannes Pfau s...@example.com wrote: Trass3r wrote: I've heard that our company is considering the T20 from Toradex.com for a new project with remote hardware. The platform runs on Nvidia Tegra and Linux. Since I have been very impressed by the D

Re: D on other platforms than Win,Lin,Mac?

2011-09-06 Thread Andrew Wiley
On Tue, Sep 6, 2011 at 1:51 PM, Nick Sabalausky a@a.a wrote: Trass3r u...@known.com wrote in message news:op.v1edf3bj3ncmek@enigma... I've heard that our company is considering the T20 from Toradex.com for a new project with remote hardware. The platform runs on Nvidia Tegra and Linux.

Re: gdc setup without gcc

2011-08-31 Thread Andrew Wiley
On Thu, Sep 1, 2011 at 12:31 AM, %u asm...@hotmail.com wrote: is there a way to install gdc without gcc because I already have gcc install in archlunix? Use the gdc2-hg PKGBUILD in the AUR.

Re: help understanding import libraries

2011-08-19 Thread Andrew Wiley
On Fri, Aug 19, 2011 at 9:38 AM, Jesse Phillips jessekphillip...@gmail.comwrote: maarten van damme Wrote: the compiler flags I needed to add was -I for every src directory and -L for the lib file. The problem with that was that those files in the src dir don't declare the functions but

Re: Permission denied under Ubuntu.

2011-08-09 Thread Andrew Wiley
On Tue, Aug 9, 2011 at 1:40 AM, Johannes Pfau s...@example.com wrote: Andrew Wiley wrote: Try `chmod +x dmd` (when in the same directory as the dmd executable). That should get fixed in the package though. Shouldn't it be `chmod +x testFile`? If I read his question correctly, compiling

Re: Permission denied under Ubuntu.

2011-08-08 Thread Andrew Wiley
On Mon, Aug 8, 2011 at 4:30 PM, Charles McAnany mcana...@rose-hulman.eduwrote: Hi, all. I installed dmd_2.054-0_amd64.deb on Ubuntu 11.04, and the compiler seems to work fine, but I can't execute its output. Here's what I'm doing: (ls to show directory contents) $ dmd testFile.d $

Re: Importing D libraries

2011-07-28 Thread Andrew Wiley
On Wed, Jul 27, 2011 at 11:46 PM, Jacob Carlborg d...@me.com wrote: On 2011-07-28 03:23, Andrew Wiley wrote: On Wed, Jul 27, 2011 at 2:10 AM, Jacob Carlborg d...@me.com mailto:d...@me.com wrote: Cannot be implemented in GDC. The driver/compiler/assembler/__** linker

Re: Importing D libraries

2011-07-27 Thread Andrew Wiley
On Tue, Jul 26, 2011 at 11:38 PM, Jacob Carlborg d...@me.com wrote: On 2011-07-26 21:34, Andrej Mitrovic wrote: On 7/26/11, Nick Sabalauskya@a.a wrote: Pellepelle.mansson@gmail.**com pelle.mans...@gmail.com wrote in message news:op.vy74cwejzu79i9@pelle-**d2608-a1... On Tue, 26 Jul

Re: Importing D libraries

2011-07-27 Thread Andrew Wiley
On Wed, Jul 27, 2011 at 2:10 AM, Jacob Carlborg d...@me.com wrote: Cannot be implemented in GDC. The driver/compiler/assembler/**linker structure doesn't allow it. Why is that? Well, the short version is that GDC (the executable) is not a compiler. GDC is a driver that runs cc1d to

Re: Importing D libraries

2011-07-26 Thread Andrew Wiley
On Tue, Jul 26, 2011 at 2:02 AM, Dainius (GreatEmerald) past...@gmail.comwrote: I must be missing something incredibly obvious here, but I can't find out what it is... I'm trying to build a very simple test program for LuaD, right now it simply imports the library. But it throws a linker

Re: DMD Backend: Deciding instructions to use/avoid?

2011-06-10 Thread Andrew Wiley
On Thu, Jun 9, 2011 at 5:58 PM, Nick Sabalausky a@a.a wrote: Bernard Helyer b.hel...@gmail.com wrote in message news:isdgdc$m3a$1...@digitalmars.com... If you run the program in GDB, can you disassemble when the error is given? That may give you the instruction the kernel is assasinating

Re: Install DWT2 using DMD and Tango

2011-06-09 Thread Andrew Wiley
On Wed, Jun 8, 2011 at 2:57 PM, Jesse Phillips jessekphillip...@gmail.comwrote: Andrew Wiley Wrote: On Wed, Jun 8, 2011 at 11:54 AM, Fabian contact-...@freenet.de wrote: Hi I'm trying to install DWT2 to create GUI applications with D. I have downloaded DWT2 with TortoiseHg already

Re: Install DWT2 using DMD and Tango

2011-06-08 Thread Andrew Wiley
On Wed, Jun 8, 2011 at 11:54 AM, Fabian contact-...@freenet.de wrote: Hi I'm trying to install DWT2 to create GUI applications with D. I have downloaded DWT2 with TortoiseHg already and I've installed Ruby and Rake. But when I try to build the packages I get the following error message:

Re: Receiving data into a type using sockets

2011-06-05 Thread Andrew Wiley
On Sun, Jun 5, 2011 at 12:55 PM, David Nadlinger s...@klickverbot.at wrote: On 6/5/11 9:49 PM, Jonathan Sternberg wrote: Cool. It compiles, but it doesn't seem to be doing exactly what I want. Say I send 2 integers from the server to the client. When I do this on the client, it seems to do

Re: how to get the local?

2011-06-01 Thread Andrew Wiley
On Thu, Jun 2, 2011 at 12:23 AM, Nick Sabalausky a@a.a wrote: Andrej Mitrovic andrej.mitrov...@gmail.com wrote in message news:mailman.521.1306960464.14074.digitalmars-d-le...@puremagic.com... From my understanding of this page

Re: How to break module into multiple file.

2011-05-23 Thread Andrew Wiley
On Mon, May 23, 2011 at 4:39 AM, Matthew Ong on...@yahoo.com wrote: On 5/23/2011 3:58 PM, Timon Gehr wrote: On 2011-05-23 00:09, Matthew Ong wrote: Thanks everyone that gave some working model to a newbie from Java Space. I found the working file layout model from dwt2

Re: Linux: How to statically link against system libs?

2011-05-09 Thread Andrew Wiley
On Mon, May 9, 2011 at 11:01 PM, Adam D. Ruppe destructiona...@gmail.comwrote: Nick Sabalausky wrote: Do we know what that switch is for? --no-warn-search-mismatch Normally ld will give a warning if it finds an incompatible library during a library search. This option silences the

Re: Why are unsigned to signed conversions implicit and don't emit a warning?

2011-04-11 Thread Andrew Wiley
On Sun, Apr 10, 2011 at 7:57 PM, Jonathan M Davis jmdavisp...@gmx.com wrote: Andrej Mitrovic: I just had a little bug in my code. In the WindowsAPI, there's this alias: alias ubyte BYTE; Unfortunately I didn't check for this, and I erroneously assumed BYTE was a signed value (blame

Re: I seem to be able to crash writefln

2011-03-09 Thread Andrew Wiley
On Wed, Mar 9, 2011 at 5:19 PM, Joel Christensen joel...@gmail.com wrote: This is on Windows 7. Using a def file to stop the terminal window coming up. win.def EXETYPE NT SUBSYSTEM WINDOWS bug.d import std.stdio; import std.string; void main() {        auto f = File( z.txt, w );      

Re: Best way in D2 to rotate a ubyte[4] array

2011-03-09 Thread Andrew Wiley
On Wed, Mar 9, 2011 at 7:25 PM, U2 fan i...@u2fan.com wrote: == Quote from bearophile (bearophileh...@lycos.com)'s article Tom: What is the most efficient way of implement a rotation of ubyte[4] array? By rotation I mean: rotateRight([1, 2, 3, 4]) - [4, 1, 2, 3] Two versions, I have done

Re: I seem to be able to crash writefln

2011-03-09 Thread Andrew Wiley
On Thu, Mar 10, 2011 at 1:31 AM, Jonathan M Davis jmdavisp...@gmx.com wrote: On Wednesday 09 March 2011 23:15:13 Andrew Wiley wrote: On Wed, Mar 9, 2011 at 5:19 PM, Joel Christensen joel...@gmail.com wrote: This is on Windows 7. Using a def file to stop the terminal window coming up

Re: dmd gdc in archlinux

2011-03-07 Thread Andrew Wiley
On Sun, Mar 6, 2011 at 10:55 PM, %u asm...@hotmail.com wrote: == Quote from %u (asm...@hotmail.com)'s article i can't install it and i use this command yaourt -R gdc i mean yaourt -S gdc It looks like in the official repositories, we have dmd, but you're not installing libtango or

Re: Sending a socket to another thread

2011-02-15 Thread Andrew Wiley
On Tue, Feb 15, 2011 at 12:00 PM, lurker lur...@mailinator.com wrote: I'd like to modify the listener sample to handle requests in separate threads but I'm experiencing weird crashes. What platform and version of DMD? There was a bug in the Socket implementation on Windows recently where the

Re: Sending a socket to another thread

2011-02-15 Thread Andrew Wiley
On Tue, Feb 15, 2011 at 4:13 PM, lurker lur...@mailinator.com wrote: What platform and version of DMD? There was a bug in the Socket implementation on Windows recently where the WinSock data was either initialized or deinitialized multiple times. I don't remember the details, but I remember

Re: Sending a socket to another thread

2011-02-15 Thread Andrew Wiley
On Tue, Feb 15, 2011 at 4:59 PM, Andrew Wiley debio...@gmail.com wrote: On Tue, Feb 15, 2011 at 4:13 PM, lurker lur...@mailinator.com wrote: What platform and version of DMD? There was a bug in the Socket implementation on Windows recently where the WinSock data was either initialized

Re: Number of references to a Class Object

2011-02-11 Thread Andrew Wiley
On Sat, Feb 12, 2011 at 1:20 AM, d coder dlang.co...@gmail.com wrote: Greetings I am in a situation where I need to know the number of references to a class' object. To explain, I have an array of class objects and I occasionally process this array. But if a particular object in this array

Re: Source code annotations alla Java

2011-01-20 Thread Andrew Wiley
On Thu, Jan 20, 2011 at 8:02 AM, Steven Schveighoffer schvei...@yahoo.comwrote: On Thu, 20 Jan 2011 08:47:28 -0500, Justin Johansson j...@nospam.com wrote: Not long ago the Java Language people introduced the idea of annotations together with an annotation processing tool (apt). Now