Re: Source code annotations alla Java

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

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 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 is not being garb

Re: Sending a socket to another thread

2011-02-15 Thread Andrew Wiley
On Tue, Feb 15, 2011 at 12:00 PM, lurker 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 WinSock data was eithe

Re: Sending a socket to another thread

2011-02-15 Thread Andrew Wiley
On Tue, Feb 15, 2011 at 4:13 PM, lurker 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 having "weird

Re: Sending a socket to another thread

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

Re: dmd & gdc in archlinux

2011-03-07 Thread Andrew Wiley
On Sun, Mar 6, 2011 at 10:55 PM, %u 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 libphobos. You must

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 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 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 wrote: > On Wednesday 09 March 2011 23:15:13 Andrew Wiley wrote: >> On Wed, Mar 9, 2011 at 5:19 PM, Joel Christensen wrote: >> > This is on Windows 7. Using a def file to stop the terminal window coming >> > up. >&g

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 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 (bla

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 wrote: > 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 warning. > > In the DMD

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 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 > http://hg.dsource.org/p

Re: how to get the local?

2011-06-01 Thread Andrew Wiley
On Thu, Jun 2, 2011 at 12:23 AM, Nick Sabalausky wrote: > "Andrej Mitrovic" wrote in message > news:mailman.521.1306960464.14074.digitalmars-d-le...@puremagic.com... > > >From my understanding of this page > > http://msdn.microsoft.com/en-us/library/dd318136%28v=vs.85%29.aspx : > > > > "Note Th

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 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 the wro

Re: Install DWT2 using DMD and Tango

2011-06-08 Thread Andrew Wiley
On Wed, Jun 8, 2011 at 11:54 AM, Fabian 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: > > http://imageshack.

Re: Install DWT2 using DMD and Tango

2011-06-08 Thread Andrew Wiley
On Wed, Jun 8, 2011 at 2:57 PM, Jesse Phillips wrote: > Andrew Wiley Wrote: > > > On Wed, Jun 8, 2011 at 11:54 AM, Fabian wrote: > > > > > Hi > > > I'm trying to install DWT2 to create GUI applications with D. > > > I have downloaded DWT2 wit

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 wrote: > "Bernard Helyer" 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 your > > process f

Re: Importing D libraries

2011-07-26 Thread Andrew Wiley
On Tue, Jul 26, 2011 at 2:02 AM, Dainius (GreatEmerald) wrote: > 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 > error for some rea

Re: Importing D libraries

2011-07-27 Thread Andrew Wiley
On Tue, Jul 26, 2011 at 11:38 PM, Jacob Carlborg wrote: > On 2011-07-26 21:34, Andrej Mitrovic wrote: > >> On 7/26/11, Nick Sabalausky wrote: >> >>> "Pelle"> wrote in >>> message >>> >>> news:op.vy74cwejzu79i9@pelle-**d2608-a1... >>> On Tue, 26 Jul 2011 13:06:56 +0200, Dainius (GreatEmeral

Re: Importing D libraries

2011-07-27 Thread Andrew Wiley
On Wed, Jul 27, 2011 at 2:10 AM, Jacob Carlborg 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 compile y

Re: Importing D libraries

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

Re: Permission denied under Ubuntu.

2011-08-08 Thread Andrew Wiley
On Mon, Aug 8, 2011 at 4:30 PM, Charles McAnany wrote: > 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 > $ ./testFile > bash: ./te

Re: Permission denied under Ubuntu.

2011-08-09 Thread Andrew Wiley
On Tue, Aug 9, 2011 at 1:40 AM, Johannes Pfau 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 corre

Re: help understanding import libraries

2011-08-19 Thread Andrew Wiley
On Fri, Aug 19, 2011 at 9:38 AM, Jesse Phillips wrote: > 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 also define them. T

Re: gdc setup without gcc

2011-08-31 Thread Andrew Wiley
On Thu, Sep 1, 2011 at 12:31 AM, %u 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: 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 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 program

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 wrote: > "Trass3r" 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. > >> > >> S

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 wrote: > Andrew Wiley wrote: > >On Tue, Sep 6, 2011 at 2:25 PM, Johannes Pfau wrote: > > > >> Trass3r wrote: > >> >> I've heard that our company is considering the T20 from > >> >> Torad

Re: .di files have implementation??

2011-10-22 Thread Andrew Wiley
On Sat, Oct 22, 2011 at 9:49 PM, Andrej Mitrovic 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 be able to inline functio

Re: Is __VERSION__ cross-compiler compatible?

2011-11-22 Thread Andrew Wiley
On Mon, Nov 21, 2011 at 8:16 PM, Andrej Mitrovic wrote: > GDC does seem to use this, now that I've tested it: > > D:\dev\code\d_code>gdc test.d > 1067L > > D:\dev\code\d_code>gdc -v2 test.d > 2052L > > I've found the docs, it states this is a compiler token: > http://d-programming-language.org/lex

Re: Matching with std.concurrency receive

2011-12-10 Thread Andrew Wiley
On Sat, Dec 10, 2011 at 1:38 PM, Jonathan M Davis 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 never the case o

Re: Restrict access to "critical" functions

2011-12-14 Thread Andrew Wiley
2011/12/12 Christian Köstlin : > 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 functions of the std-librar

Re: Are D classes always garbage collected?

2011-12-21 Thread Andrew Wiley
On Wed, Dec 21, 2011 at 10:20 PM, Froglegs 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 page

Re: writing iterators without code duplication. inout?

2011-12-22 Thread Andrew Wiley
On Thu, Dec 22, 2011 at 12:04 AM, pompei2 wrote: >> int delegate(int delegate(ref int)) doIter() const >>  { >> 74      return (int delegate(ref int) dg) >>      { >>        cast(typeof(this))(this).doIter() >> 77            ( >> 78              (ref int i) >> >>              { >>                i

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 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: Catching signals with D

2011-12-24 Thread Andrew Wiley
On Sat, Dec 24, 2011 at 7:37 AM, Matej Nanut 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 > signal handlers,

Re: Reading about D: few questions

2011-12-24 Thread Andrew Wiley
2011/12/24 Mr. Anonymous : > 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

Re: Reading about D: few questions

2011-12-24 Thread Andrew Wiley
On Sat, Dec 24, 2011 at 9:50 AM, Timon Gehr wrote: > On 12/24/2011 06:18 PM, Andrew Wiley wrote: >> >> 2011/12/24 Mr. Anonymous: >> >>> On 24.12.2011 19:01, Denis Shelomovskij wrote: >>>> >>>> >>>> 23.12.2011 22:51, bea

Re: Reading about D: few questions

2011-12-24 Thread Andrew Wiley
On Sat, Dec 24, 2011 at 1:08 PM, Timon Gehr wrote: > On 12/24/2011 07:00 PM, Andrew Wiley wrote: >> >> On Sat, Dec 24, 2011 at 9:50 AM, Timon Gehr  wrote: >>> >>> On 12/24/2011 06:18 PM, Andrew Wiley wrote: >>> >>>> >>>> 2011/12/24

Re: Reading about D: few questions

2011-12-24 Thread Andrew Wiley
On Sat, Dec 24, 2011 at 1:45 PM, Timon Gehr 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 Gehr wrote: >>>> >>>> On 12/24/2011 07:00 PM, A

Re: Linking problem on Mac OS X

2011-12-24 Thread Andrew Wiley
On Sat, Dec 24, 2011 at 6:29 PM, Robert Rouse 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: GetAndSet function (corresponding to cas function)

2011-12-26 Thread Andrew Wiley
On Mon, Dec 26, 2011 at 2:34 PM, 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). > > I know that in D there is the cas function (equivalent to Java's > compareA

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 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). >> >> I k

Re: AA char[] as key

2012-01-03 Thread Andrew Wiley
On Tue, Jan 3, 2012 at 1:25 PM, simendsjo 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 > T[immutable(char)[]] ins

Re: AA char[] as key

2012-01-03 Thread Andrew Wiley
On Tue, Jan 3, 2012 at 1:41 PM, Andrew Wiley wrote: > On Tue, Jan 3, 2012 at 1:25 PM, simendsjo 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 wrote: > On 03.01.2012 20:41, Andrew Wiley wrote: >> >> On Tue, Jan 3, 2012 at 1:25 PM, simendsjo  wrote: >>> >>> seems T[char[]] is rewritten as T[const(char)[]], and does not accept >>> char[] >>> as ke

Re: AA char[] as key

2012-01-03 Thread Andrew Wiley
On Tue, Jan 3, 2012 at 4:20 PM, bearophile 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 at tha

Re: Singleton Pattern

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

Re: Singleton question (shared class)

2012-01-25 Thread Andrew Wiley
On Wed, Jan 25, 2012 at 9:35 AM, Steven Schveighoffer 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 >> would be in

Re: std.socket with GDC

2012-02-25 Thread Andrew Wiley
On Sat, Feb 25, 2012 at 4:45 PM, DNewbie 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 compil

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 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). >> >>> >>> > Wait, isn'

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 wrote: > On Wed, 16 May 2012 15:24:33 +0100, ref2401 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 = createArray(); >> int value = array[2..3]

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 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 > wrote: > > > > > On Wed, 16 May 2012 15:24:33 +0100, ref2401 > wrote: > > > >

Re: floats default to NaN... why?

2012-06-08 Thread Andrew Wiley
On Thu, Jun 7, 2012 at 6:50 PM, Minas 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 uninitialized is bad style, bad pract

Re: Segmentation fault hell in D

2012-06-08 Thread Andrew Wiley
On Fri, Jun 8, 2012 at 11:29 AM, Jonathan M Davis wrote: > On Friday, June 08, 2012 19:30:57 Jarl André" > @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 > > try to eleminate whats creat

Re: Segmentation fault hell in D

2012-06-09 Thread Andrew Wiley
On Sat, Jun 9, 2012 at 6:09 AM, Dejan Lekic 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 >> wrote: >> >>> On Friday, June 08, 2012 19:30:57 Jarl André" >>> @puremagic.com w

Re: floats default to NaN... why?

2012-06-09 Thread Andrew Wiley
On Sat, Jun 9, 2012 at 11:57 AM, Kevin 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 we can do is 0. With floats, NaN makes it better. > >>> > >>> With the logic tha

Re: floats default to NaN... why?

2012-06-09 Thread Andrew Wiley
On Sat, Jun 9, 2012 at 4:53 PM, Andrew Wiley wrote: > > On Sat, Jun 9, 2012 at 11:57 AM, Kevin 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, Mina

Re: Windows program instant crash: no messages.

2012-06-12 Thread Andrew Wiley
On Tue, Jun 12, 2012 at 1:32 AM, Dmitry Olshansky 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 the resultin

Re: Windows program instant crash: no messages.

2012-06-12 Thread Andrew Wiley
On Tue, Jun 12, 2012 at 1:50 AM, Andrew Wiley wrote: > On Tue, Jun 12, 2012 at 1:32 AM, Dmitry Olshansky > 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

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 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 Bar();