DWin 0.39 released

2009-04-12 Thread yidabu
DWin is a library for the D Programming language, Packages included in DWin cover such areas as : Windows COM client programming, Windows IE autmation, PCRE Regular Expression, SQLite D wrapper and more... DWin 0.39 has been released, tested with DMD 1.042 and Tango 0.99.8 on Windows (should

Re: The new, new phobos sneak preview

2009-04-12 Thread Daniel Keep
Andrei Alexandrescu wrote: Jarrett Billingsley wrote: On Sat, Apr 11, 2009 at 7:36 PM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: I wonder what a good name would be. How about... umm... oh I don't know. Tuple? Tuple is taken by tuples. Andrei Every language I know

invariant()

2009-04-12 Thread Michel Fortin
In D1 you had to write: invariant { ... } while in D2, to disabiguate with invariant being overloaded with immutability you had to write: invariant() { ... } Now that the use of the invariant keyword in D2 has

Re: The new, new phobos sneak preview

2009-04-12 Thread Lars Kyllingstad
Andrei Alexandrescu wrote: Lars Kyllingstad wrote: Andrei Alexandrescu wrote: Hi everybody, I just committed all of Phobos into svn on dsource.org. That is not an official release and has known and unknown bugs, limitations, and rhinodemons. I expect some ripples before we stabilize, but

Re: what are the most common bugs in your D apps?

2009-04-12 Thread Jarrett Billingsley
On Sun, Apr 12, 2009 at 9:28 AM, bearophile bearophileh...@lycos.com wrote: The following one isn't a problem of D, it's a small bug I've created while translating C code to D. Here I have reduced the code to a very small proggy, so you probably need only a moment to spot the problem. This

Re: Associative arrays with void values

2009-04-12 Thread torhu
On 12.04.2009 17:50, Doctor J wrote: Sometimes you want to use an associative array just to track keys you've seen, or count distinct keys, and you don't care about the values. The language will let you declare an array such as void[int]; but you can't actually do anything with it: void

Re: what are the most common bugs in your D apps?

2009-04-12 Thread Nick Sabalausky
Jarrett Billingsley jarrett.billings...@gmail.com wrote in message news:mailman.1145.1239546503.22690.digitalmar...@puremagic.com... On Sun, Apr 12, 2009 at 9:28 AM, bearophile bearophileh...@lycos.com wrote: Your C code also contains a bug, if chars are unsigned. I will agree, however, that

Re: The new, new phobos sneak preview

2009-04-12 Thread Michel Fortin
On 2009-04-12 11:09:51 -0400, Lars Kyllingstad pub...@kyllingen.nospamnet said: Andrei Alexandrescu wrote: Lars Kyllingstad wrote: I think isInfinite!() should be called isInfiniteRange!(). The current name is, in my opinion, too general. I'm undecided about this (and similar cases).

Re: Anyone want to maintain Planet D?

2009-04-12 Thread Clay Smith
Anders Bergh wrote: Hi, I need someone to take over Planet D because I don't have time for maintaining it. I use Planet Planet to generate static HTML which is uploaded to dsource, so there's no web hosting involved. All it needs to work is Python, cron and ncftp. Adding new feeds is very

D2 porting notes: template function calls

2009-04-12 Thread Michel Fortin
I've converted some of parser code to work with D2. Here are some things I noted during the process. First, it seems writefln is now a template. Good idea... but that broke some of my calls to it: writefln; // D1: writes a new line // D2: error, template declaration

Re: Std Phobos 2 and logging library?

2009-04-12 Thread Leandro Lucarella
Robert Jacques, el 11 de abril a las 01:05 me escribiste: On Fri, 10 Apr 2009 23:04:16 -0400, Leandro Lucarella llu...@gmail.com wrote: I hope I can come up with something useful with my thesis (improving D's GC) and I can contribute that. Right now all my energies are focused on that, and

Re: Std Phobos 2 and logging library?

2009-04-12 Thread Leandro Lucarella
dsimcha, el 11 de abril a las 05:21 me escribiste: == Quote from Leandro Lucarella (llu...@gmail.com)'s article Andrei Alexandrescu, el 10 de abril a las 16:49 me escribiste: And Braddr just made a documentation fix, and Walter only commits portability stuff and an occasional bug fix now

Re: Std Phobos 2 and logging library?

2009-04-12 Thread Denis Koroskin
On Sun, 12 Apr 2009 21:13:09 +0400, Leandro Lucarella llu...@gmail.com wrote: Robert Jacques, el 11 de abril a las 01:05 me escribiste: On Fri, 10 Apr 2009 23:04:16 -0400, Leandro Lucarella llu...@gmail.com wrote: I hope I can come up with something useful with my thesis (improving D's GC)

Re: The new, new phobos sneak preview

2009-04-12 Thread Leandro Lucarella
Michel Fortin, el 12 de abril a las 12:54 me escribiste: On 2009-04-12 11:09:51 -0400, Lars Kyllingstad pub...@kyllingen.nospamnet said: Andrei Alexandrescu wrote: Lars Kyllingstad wrote: I think isInfinite!() should be called isInfiniteRange!(). The current name is, in my opinion, too

Re: Std Phobos 2 and logging library?

2009-04-12 Thread Leandro Lucarella
Denis Koroskin, el 12 de abril a las 21:26 me escribiste: I think I'll target D1 for now. The reasons are: * Stability * Free compilers availability (you know what kind of free I'm talking about =) * Programs availability (I'm trying to gather programs to make a benchmark suite, without

Re: The new, new phobos sneak preview

2009-04-12 Thread Leandro Lucarella
Leandro Lucarella, el 12 de abril a las 15:19 me escribiste: Michel Fortin, el 12 de abril a las 12:54 me escribiste: On 2009-04-12 11:09:51 -0400, Lars Kyllingstad pub...@kyllingen.nospamnet said: Andrei Alexandrescu wrote: Lars Kyllingstad wrote: I think isInfinite!() should be

Re: Associative arrays with void values

2009-04-12 Thread bearophile
Doctor J: In my libs there is a Set(), but it maps to the built-in AAs: http://www.fantascienza.net/leonardo/so/dlibs/sets.html (and adds set methods). Adding sets to the language as AAs with void values, plus set methods is nice. Bye, bearophile

Re: Std Phobos 2 and logging library?

2009-04-12 Thread Christopher Wright
Leandro Lucarella wrote: dsimcha, el 11 de abril a las 05:21 me escribiste: == Quote from Leandro Lucarella (llu...@gmail.com)'s article Andrei Alexandrescu, el 10 de abril a las 16:49 me escribiste: And Braddr just made a documentation fix, and Walter only commits portability stuff and an

Re: bigfloat

2009-04-12 Thread Benji Smith
Daniel Keep wrote: Andrei Alexandrescu wrote: dsimcha wrote: Well, now that I understand your proposal a little better, it makes sense. I had wondered why the current AA implementation uses RTTI instead of templates. Even better would be if only the default implementation were in Object,

Re: bigfloat

2009-04-12 Thread bearophile
Benji Smith: // Defaults to using built-in associative array type auto assocArray = [ hello : world ]; // Uses my own custom type. auto hashtable = MyHashTableType!(string, string) [ hello : world ]; In the second case the type inference of the

Re: Std Phobos 2 and logging library?

2009-04-12 Thread Leandro Lucarella
Christopher Wright, el 12 de abril a las 17:54 me escribiste: Absolutely. When writing parallel code to do large scale data mining in D, the lack of precision and multithreaded allocation are real killers. My interests are, in order of importance: 1. Being able to allocate at least

Re: bigfloat

2009-04-12 Thread Benji Smith
bearophile wrote: Benji Smith: // Defaults to using built-in associative array type auto assocArray = [ hello : world ]; // Uses my own custom type. auto hashtable = MyHashTableType!(string, string) [ hello : world ]; In the second case the type

Re: demangle tool

2009-04-12 Thread Sergey Gromov
Fri, 10 Apr 2009 14:25:30 -0700, Andrei Alexandrescu wrote: Sergey Gromov wrote: Thu, 09 Apr 2009 13:40:36 -0700, Andrei Alexandrescu wrote: The line wraps are all garbled, but you get the idea: all symbols quoted `like this' have been demangled appropriately. Below is the source of the

The great inapplicable attribute debate

2009-04-12 Thread Stewart Gordon
It's cropped up on a number of occasions. And again in the comments on http://d.puremagic.com/issues/show_bug.cgi?id=2830 http://d.puremagic.com/issues/show_bug.cgi?id=1441 which are essentially the same as each other. The basic matter of debate is: If an attribute is applied to something to

Re: Associative arrays with void values

2009-04-12 Thread bearophile
dsimcha: 1. Without the void[someType] hack, it wastes at least one byte per element, sometimes a lot more depending on alignment issues. I think it never wastes one byte. The GC allocates blocks of memory with a length as a power of 2, for small sizes. You can see this very well if you do

Re: invariant()

2009-04-12 Thread Michel Fortin
On 2009-04-12 19:08:08 -0400, Stewart Gordon smjg_1...@yahoo.com said: Michel Fortin wrote: snip Now that the use of the invariant keyword in D2 has returned to its single original meaning of class invariant, Where do you get that idea from??? D 2.020's changelog: - immutable now is

Re: The new, new phobos sneak preview

2009-04-12 Thread Michel Fortin
On 2009-04-12 14:24:07 -0400, Leandro Lucarella llu...@gmail.com said: Leandro Lucarella, el 12 de abril a las 15:19 me escribiste: Michel Fortin, el 12 de abril a las 12:54 me escribiste: On 2009-04-12 11:09:51 -0400, Lars Kyllingstad pub...@kyllingen.nospamnet said: Perhaps it should be

Re: Associative arrays with void values

2009-04-12 Thread dsimcha
== Quote from bearophile (bearophileh...@lycos.com)'s article dsimcha: 1. Without the void[someType] hack, it wastes at least one byte per element, sometimes a lot more depending on alignment issues. I think it never wastes one byte. The GC allocates blocks of memory with a length as a

Re: The new, new phobos sneak preview

2009-04-12 Thread Daniel Keep
Michel Fortin wrote: On 2009-04-12 14:24:07 -0400, Leandro Lucarella llu...@gmail.com said: Leandro Lucarella, el 12 de abril a las 15:19 me escribiste: Michel Fortin, el 12 de abril a las 12:54 me escribiste: On 2009-04-12 11:09:51 -0400, Lars Kyllingstad pub...@kyllingen.nospamnet said:

Re: The great inapplicable attribute debate

2009-04-12 Thread Nick Sabalausky
Stewart Gordon smjg_1...@yahoo.com wrote in message news:grtr90$1hl...@digitalmars.com... It's cropped up on a number of occasions. And again in the comments on http://d.puremagic.com/issues/show_bug.cgi?id=2830 http://d.puremagic.com/issues/show_bug.cgi?id=1441 which are essentially the

Re: The great inapplicable attribute debate

2009-04-12 Thread Nick Sabalausky
BCS n...@anon.com wrote in message news:a6268ff4a7a8cb89c641dc8...@news.digitalmars.com... Hello Stewart, Perhaps what complicates matters further is that D has three ways of specifying attributes: (i) as part of the declaration itself I more or less only use this. (ii) in a block

Re: The great inapplicable attribute debate

2009-04-12 Thread BCS
Hello grauzone, BCS wrote: Just my $0.02 because that might make things less complex. And if you want to remove complexity, start with the bigger chunks of the D language. complexity re the OP's point, not just in general. if only (i) is allowed then there isn't (much of) a case for

Re: Associative arrays with void values

2009-04-12 Thread bearophile
dsimcha: What if the key is a long? At the moment an AA like this: byte[long] aa; allocates 16 or more bytes/pair, so it needs the same memory as: long[long] aa; A built-in set can of course use only about 8 bytes (plus few empty cells in the hash) for a: HashSet!(long) Bye, bearophile

Re: Associative arrays with void values

2009-04-12 Thread bearophile
Benji Smith: Especially since an associative array should have a .keys property that returns a set. I don't agree. I think associative arrays should have .keys/.values/.items that return a lazy view that acts like a .set/.list/.list of pairs. Such lazy views don't actually store anything,

Does org.eclipse.core.jobs works now?

2009-04-12 Thread yidabu
I run a background thread by Job, the app crashing on runtime exception: No symbols available from sxs.dll sxs.dll loaded at 0x75e9 Unhandled D Exception (tango.core.Exception.IOException console :: The handle is invalid.) at KERNEL32.dll (0x7c812a5b) thread(3356) -us #0 ?? () from

org.eclipse.core.jobs works test case

2009-04-12 Thread yidabu
Exception with test case: 3249 Fatal dwt - java\util\HashSet.d 31: implementation missing in file java\util\HashSet.d line 31 3255 Fatal dwt - java\util\HashSet.d 31: Please create a bug report at http://www.dsource.org/projects/dwt 3261 Fatal dwt - java\util\HashSet.d 31: exiting ... the

Re: D1 and read-only views?

2009-04-12 Thread Daniel Keep
As others have stated, your surmise is correct. On a related note, I recently wrote a very simple cstring struct that acts like const(char)[] does in D2. I was using unique interned strings, and didn't want any surprises. You can still get a mutable reference to the string by using .toString,

Re: private module symbols

2009-04-12 Thread Flo
Gide Nwawudu Wrote: Looks like a variant of bug 314. http://d.puremagic.com/issues/show_bug.cgi?id=314 Gide I see. Although this means its not only a problem with static, selective or renamed imports but with importing in general. And I think this is a severe one since protection is

ftp connection with socket

2009-04-12 Thread Tyro[a.c.edwards]
Hi, I hoping someone could whip up an example of how to check if it's possible to connect to a given site: eg. ftp.digitalmars.com and display a message if unsuccessful. If one is already available, could someone please point me to it? Thanks, Andrew

Re: ftp connection with socket

2009-04-12 Thread Tyro[a.c.edwards]
Per Jarrett Billingsley's advice, the following is provided: I am using DMD v2.028 w/Phobos 2 Thanks again. Tyro[a.c.edwards] Wrote: Hi, I hoping someone could whip up an example of how to check if it's possible to connect to a given site: eg. ftp.digitalmars.com and display a message

Determining if a symbol is a function

2009-04-12 Thread Doctor J
I want to test whether a struct member is a real field or a property at compile time. I thought this is what is(type == function) is supposed to do, but I can't find anything that will make is(type == function) true. What am I doing wrong? --

Re: Determining if a symbol is a function

2009-04-12 Thread Doctor J
Answered my own question: static if (is(typeof(func0) == function)) writefln(func0 is a function.); is() really wants a type, not an expression.

Re: When asking for help on how to do something...

2009-04-12 Thread Tyro[a.c.edwards]
Jarrett Billingsley Wrote: Please, *please* indicate whether you are using Phobos 1, Phobos 2, or Tango. It's hard enough trying to read your mind about what you're trying to do. It's even harder when there are two or three completely different solutions to it. Jarrett, I've always used

Re: When asking for help on how to do something...

2009-04-12 Thread Tyro[a.c.edwards]
Jarrett Billingsley Wrote: Please, *please* indicate whether you are using Phobos 1, Phobos 2, or Tango. It's hard enough trying to read your mind about what you're trying to do. It's even harder when there are two or three completely different solutions to it. Jarrett, I've always used

Using readExact with a struct containing a dynamic array

2009-04-12 Thread Charles Hixson
I want to create a struct like this: struct test { int item 1; int item 2; int dataLen; ubyte[] data; } Then I want to read write the structure using readExact and writeExact. Can I do this (somehow?) or do I need to do the reads/writes separately for each piece? I'm sure I

Re: Indexing an associative array with a list of types

2009-04-12 Thread Stewart Gordon
Doctor J wrote: snip Correct. At compile time, I want to build up an associative array mapping type tuples to integers. Then, again at compile time, I want to query it. How about this? -- import std.typetuple, std.stdio; template typesToInt(T1 : int, T2 : float) { const int

[Issue 2833] New: DMD returns -1073741819 on Intel Quadcore

2009-04-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2833 Summary: DMD returns -1073741819 on Intel Quadcore Product: D Version: 2.027 Platform: PC OS/Version: Windows Status: NEW Severity: normal Priority: P3

[Issue 2833] DMD returns -1073741819 on Intel Quadcore

2009-04-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2833 unkn...@simplemachines.org changed: What|Removed |Added CC||unkn...@simplemachines.org

[Issue 2833] DMD returns -1073741819 on Intel Quadcore

2009-04-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2833 --- Comment #3 from 2kor...@gmail.com 2009-04-12 19:28 --- FWIW, I have Windows 7 and Core 2 Duo. DMD always returns 0. --