Re: invariant()

2009-04-13 Thread Kagamin
Michel Fortin Wrote: is there still a reason for it to require an empty parenthesis? It's a function :)

Ternary Search Trees

2009-04-13 Thread bearophile
Does someone has some need for Ternary Search Trees into Phobos (for D1. And eventually later for D2 too)? TSTs allow to find keys, key prefixes, or even keys with holes. Keys are arrays of T, where T is the template type. They can be designed to store the keys alone, or as an associative data

Re: Std Phobos 2 and logging library?

2009-04-13 Thread Frits van Bommel
Leandro Lucarella wrote: 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

Re: The great inapplicable attribute debate

2009-04-13 Thread Stewart Gordon
Frits van Bommel wrote: Kagamin wrote: snip Such mood was always in the spec: AlignAttribute is ignored when applied to declarations that are not structs or struct members. I never saw that before. So it doesn't work for class members? http://www.digitalmars.com/d/1.0/class.html The D

Re: The great inapplicable attribute debate

2009-04-13 Thread Denis Koroskin
On Mon, 13 Apr 2009 16:44:25 +0400, Tomas Lindquist Olsen tomas.l.ol...@gmail.com wrote: On Mon, Apr 13, 2009 at 2:05 PM, Frits van Bommel fvbom...@remwovexcapss.nl wrote: Kagamin wrote: Stewart Gordon Wrote: At the moment, the problem seems to be that the compiler is silently ignoring

properties using template mixins and alias this

2009-04-13 Thread Michel Fortin
I came upon realization that you can already create properties accepting various operators in D, using a template mixin. The only missing part is getting the value without a getter function. struct Z { int value2Cache; template Property() { int

Re: The new, new phobos sneak preview

2009-04-13 Thread Andrei Alexandrescu
Lars Kyllingstad wrote: Michel Fortin wrote: 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

Re: The new, new phobos sneak preview

2009-04-13 Thread Rainer Deyke
Michel Fortin wrote: I disagree. How adding the is it disambiguate between the predicate and the assertion? x.isBounded reads more like x is bounded (the assertion) than is x bounded (the predicate). Method syntax usually leads to incorrect word order. a.b(c), should not be read as a does b

Re: (Semi) precise GC [was: Re: Std Phobos 2 and logging library?]

2009-04-13 Thread Frits van Bommel
Sean Kelly wrote: Leandro Lucarella wrote: But right now gc_malloc() doesn't take any TypeInfo argument. I can't see where I can get the TypeInfo in the first place =/ The call would have to be modified. Right now the best you can do is pass BlkAttr.NO_SCAN. And storing a pointer per block

Re: The new, new phobos sneak preview

2009-04-13 Thread Daniel Keep
Andrei Alexandrescu wrote: Daniel Keep wrote: ... So essentially we're looking at a symbolic approach - a resumable range would need to advertise that. I've used that for isSorted too, and it works pretty well. The remaining question is one of defaults - are most ranges resumable or

Re: Associative arrays with void values

2009-04-13 Thread Benji Smith
bearophile wrote: 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

Re: The new, new phobos sneak preview

2009-04-13 Thread Andrei Alexandrescu
Daniel Keep wrote: Actually, I've been thinking and I realised that in 95% of cases, you can assume a range is resumable if it has no references. Well I'm not so sure. How about a range around an integral file handle or socket? If it has no references, the only way the range can be

Re: The new, new phobos sneak preview

2009-04-13 Thread Benji Smith
Andrei Alexandrescu wrote: Daniel Keep wrote: Actually, I've been thinking and I realised that in 95% of cases, you can assume a range is resumable if it has no references. Well I'm not so sure. How about a range around an integral file handle or socket? If ranges can advertise their

Re: org.eclipse.core.jobs works test case

2009-04-13 Thread Frank Benoit
yidabu schrieb: 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

Re: Convert from console input

2009-04-13 Thread Sam Hu
Thanks.It works now.

Re: Determining if a symbol is a function

2009-04-13 Thread Lars Kyllingstad
Doctor J wrote: Answered my own question: static if (is(typeof(func0) == function)) writefln(func0 is a function.); is() really wants a type, not an expression. You say you want to test whether a struct/class member is a field or a property. Pointers to class and struct methods

[Issue 2833] DMD returns -1073741819 on Intel Quadcore

2009-04-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2833 --- Comment #5 from webmas...@aj-productions.de 2009-04-13 03:40 --- (In reply to comment #1) (WTF it's completely unnecessary to put all these corporate trademark tags in a bug report ;) I was just giving the full CPU name string