Re: What every D programmer really wants

2010-11-09 Thread Andrew Wiley
On Tue, Nov 9, 2010 at 11:23 PM, Zuzu's Petals wrote: > They want C++ (whether they know it yet or not), because it is less > complex, is easier to learn and use, is stable and has a well- > defined/directed/managed evolutionary path. That it has some weird > constructs is a trivial issue relativ

Re: why a part of D community do not want go to D2 ?

2010-11-10 Thread Andrew Wiley
On Wed, Nov 10, 2010 at 4:00 PM, bearophile wrote: > Eric Poggel: > > > On 11/10/2010 3:16 PM, dsimcha wrote: > > > Don't make it a class if it can be a free > > > function. > > > > I agree with most of the others except for this one. > > Object oriented programming is a way to think about code, s

Re: why a part of D community do not want go to D2 ?

2010-11-10 Thread Andrew Wiley
On Wed, Nov 10, 2010 at 5:27 PM, Daniel Gibson wrote: > Andrew Wiley schrieb: > > >> One thought here: >> If Tango is still useful in the D world but there isn't too much >> enthusiasm about porting it to D2, why not break its functionality (that >> isn

Re: why a part of D community do not want go to D2 ?

2010-11-10 Thread Andrew Wiley
On Wed, Nov 10, 2010 at 5:27 PM, Daniel Gibson wrote: > Andrew Wiley schrieb: > > >> One thought here: >> If Tango is still useful in the D world but there isn't too much >> enthusiasm about porting it to D2, why not break its functionality (that >> isn

Re: why a part of D community do not want go to D2 ?

2010-11-10 Thread Andrew Wiley
On Wed, Nov 10, 2010 at 5:43 PM, Daniel Gibson wrote: > Andrew Wiley schrieb: > >> >> >> On Wed, Nov 10, 2010 at 5:27 PM, Daniel Gibson > metalcae...@gmail.com>> wrote: >> >>Andrew Wiley schrieb: >> >> >>One thought he

Re: duck!

2010-11-11 Thread Andrew Wiley
hat Scala tends to use structural typing with inline type declarations (although they don't have to be inline). However, the basic concept is the same, where a class is dynamically checked for compliance with a static type. Not quite dynamic typing, but definitely related. If you're after a more accurate description, how would that work? Andrew Wiley

Re: duck!

2010-11-11 Thread Andrew Wiley
On Thu, Nov 11, 2010 at 11:25 AM, Andrew Wiley wrote: > On Thu, Nov 11, 2010 at 10:01 AM, Bruno Medeiros > wrote: > >> On 11/11/2010 14:19, Bruno Medeiros wrote: >> >>> way in the future. I think dynamic languages are somewhat of a niche >>> (even if a gro

Re: The D Scripting Language

2010-11-12 Thread Andrew Wiley
tradeoff between convenience and protection there hasn't ever been considered because the protection definitely isn't worth the inconvenience of having to start everything from a command prompt. Andrew Wiley

Re: The D Scripting Language

2010-11-13 Thread Andrew Wiley
On Sat, Nov 13, 2010 at 4:15 AM, spir wrote: > On Fri, 12 Nov 2010 14:42:38 -0500 > sybrandy wrote: > > > > 2. Make Windows to open .d files with rdmd by default, so I could run > them > > > with simple double-click > > > > > > > You should be able to do this yourself quite easily by right-click

Re: linker wrapper

2010-11-13 Thread Andrew Wiley
On Sat, Nov 13, 2010 at 5:02 PM, bearophile wrote: > Walter Bright: > > > bearophile wrote: > > > A new fresh trouble, I think I have already seen about 10-15 persons > ask this question in D.learn: > > > > http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learn&article_id=

Re: linker wrapper

2010-11-13 Thread Andrew Wiley
On Sat, Nov 13, 2010 at 9:14 PM, bearophile wrote: > > > If you don't even see the usefulness of more readable linker errors then... > why are where here? Aren't we trying to improve older languages? I said that improved error messages would be helpful. I may have misinterpreted you when you said

Re: Looking for champion - std.lang.d.lex

2010-11-19 Thread Andrew Wiley
On Fri, Nov 19, 2010 at 4:20 PM, bearophile wrote: > Bruno Medeiros: > > > Java is quickly becoming a legacy language? the next COBOL? SRSLY?... > > Just two years ago, the now hugely popular Android platform choose Java > > as it's language of choice, and you think Java is becoming legacy?... > >

Re: Simple @tagged attribute for unions [OT]

2010-11-19 Thread Andrew Wiley
On Fri, Nov 19, 2010 at 5:46 PM, Bruno Medeiros wrote: > On 22/10/2010 04:04, Andrei Alexandrescu wrote: > >> On 10/21/2010 08:41 PM, bearophile wrote: >> >>> I have suggested yet another attribute, @tagged: >>> http://d.puremagic.com/issues/show_bug.cgi?id=5097 >>> >>> Bye, bearophile >>> >> >>

Re: D1 -> D2

2010-11-19 Thread Andrew Wiley
On Fri, Nov 19, 2010 at 6:18 PM, Walter Bright wrote: > Bernard Helyer wrote: > >> No. The contents of a version block is still parsed. If the D2 code >> doesn't _parse_ as valid D1, then the D1 compiler will reject it, even if >> the version block will not be processed further than that. >> > > Y

Re: D1 -> D2

2010-11-19 Thread Andrew Wiley
On Fri, Nov 19, 2010 at 7:14 PM, Walter Bright wrote: > Andrew Wiley wrote: > >> I'm a fan of parsing false version blocks, but it seems like there should >> be some sort of exception for version blocks for a different version of the >> language. Could they just be s

Re: std.algorithm.remove and principle of least astonishment

2010-11-21 Thread Andrew Wiley
On Mon, Nov 22, 2010 at 1:08 AM, Andrei Alexandrescu < seewebsiteforem...@erdani.org> wrote: > On 11/21/10 11:59 PM, Rainer Deyke wrote: > >> On 11/21/2010 21:56, Andrei Alexandrescu wrote: >> >>> On 11/21/10 22:09 CST, Rainer Deyke wrote: >>> - When writing code that uses T[], it is

Re: Looking for champion - std.lang.d.lex

2010-11-24 Thread Andrew Wiley
> > On 24/10/2010 00:46, bearophile wrote: > >> Walter: >> >> >> As we all know, tool support is important for D's success. Making tools >>> easier >>> to build will help with that. >>> >>> To that end, I think we need a lexer for the standard library - >>> std.lang.d.lex. >>> It would be helpful

Re: Logical const

2010-11-30 Thread Andrew Wiley
2010/11/30 Walter Bright > so wrote: > >> No need to go that far. >> >> void fn(const A, A) {...} >> A a; >> fn(a, a); // what do you expect here? >> >> As far as i know D/C++ have the same treatment for const member functions. >> It has been this way forever. >> > > > Yup. It's why I think it is

Re: Setting the stack size

2010-12-01 Thread Andrew Wiley
On Wed, Dec 1, 2010 at 2:36 PM, bearophile wrote: > Franciszek Czekala: > > > How do you set the stack size for D programs? > > On Windows with DMD this is how to set the max stack size to about 1.5 GB > of the "test.d" module: > dmd -L/STACK:15 test.d > > (I'd like D to have a standard s

Re: Setting the stack size

2010-12-01 Thread Andrew Wiley
On Wed, Dec 1, 2010 at 7:14 PM, Mike Parker wrote: > On 12/2/2010 6:12 AM, Andrew Wiley wrote: > >> >> >> On Wed, Dec 1, 2010 at 2:36 PM, bearophile > <mailto:bearophileh...@lycos.com>> wrote: >> >>Franciszek Czekala: >> >>

Re: Slides from my ACCU Silicon Valley talk

2010-12-13 Thread Andrew Wiley
On Mon, Dec 13, 2010 at 8:50 PM, lurker wrote: > > Why don't you retard, I mean eternium, I mean iLikeCakes, I mean snk_kid, I mean WeAreAllTreeBear, I mean bearophile's alter ego, go someplace else. Waisting time here is really not worth it. They provide psychiatric treatment in hospitals. I can'

Re: emscripten

2010-12-15 Thread Andrew Wiley
On Wed, Dec 15, 2010 at 9:37 AM, Adam D. Ruppe wrote: > > And in those rare cases where you are doing a lot of client side work, it > is so > brutally slow that if you start piling other runtimes on top of it, you'll > often > be left with an unusable mess anyway! Unless you're using the beta of

Re: emscripten

2010-12-15 Thread Andrew Wiley
On Wed, Dec 15, 2010 at 11:24 AM, Andrew Wiley wrote: > On Wed, Dec 15, 2010 at 9:37 AM, Adam D. Ruppe > wrote: >> >> And in those rare cases where you are doing a lot of client side work, it >> is so >> brutally slow that if you start piling other runtimes on to

Re: emscripten

2010-12-15 Thread Andrew Wiley
On Wed, Dec 15, 2010 at 12:18 PM, Nick Sabalausky wrote: > > A game that was designed to run on a 90-133MHz 16-24MB RAM machine (in > *software* rendering mode), and was frequently able to get framerates in > the > hundreds on sub-500MHz machines (using hardware rendering - with the old, > old, ol

Re: emscripten

2010-12-15 Thread Andrew Wiley
On Wed, Dec 15, 2010 at 3:16 PM, Nick Sabalausky wrote: > "Michael Stover" wrote in message > news:mailman.1041.1292446362.21107.digitalmar...@puremagic.com... > > >With my own computer, there are things I can do to prevent that. With > > webapps I'm 100% reliant on someone else: there isn't a d

Re: Why Ruby?

2010-12-18 Thread Andrew Wiley
On Sat, Dec 18, 2010 at 12:09 PM, Jacob Carlborg wrote: > > > Actually if it would be possible to skip the parentheses when the lambda > take more than one argument I would be more happy with that: > > foo(x, y => x * y); > > Pretty sure you'll need parenthesis. Should the above match: func(int fu

Re: memoize

2011-01-03 Thread Andrew Wiley
On Mon, Jan 3, 2011 at 10:15 PM, Andrei Alexandrescu < seewebsiteforem...@erdani.org> wrote: > I just added a higher-order function memoize to std.functional which I > think is pretty cool. See the docs here: > > > http://d-programming-language.org/cutting-edge/phobos/std_functional.html#memoize >

Re: What are we missing, in terms of tool support?

2011-01-13 Thread Andrew Wiley
On Thu, Jan 13, 2011 at 11:54 AM, Dmitry Olshansky wrote: > On 13.01.2011 10:40, Jim wrote: > >> I don't want to make this Vim-specific, so I'm wondering what features are >>> we missing in today's D editors/IDE's that other languages already have in >>> their editors/IDE's? >>> >> >> IDE with inc

Re: DVCS

2011-01-20 Thread Andrew Wiley
On Thu, Jan 20, 2011 at 5:39 AM, Jeff Nowakowski wrote: > On 01/20/2011 12:24 AM, Gour wrote: > >> Otoh, with Ubuntu, upgrade from 8.10 to 10.10 is always a major >> undertaking (I'm familiar with it since '99 when I used SuSE and had >> experience with deps hell.) >> > > Highlighting the proble

Re: Opt-out closures

2011-01-23 Thread Andrew Wiley
On Sun, Jan 23, 2011 at 9:08 AM, bearophile wrote: > Sean Eskapp: > > > I want to be able to access the enclosing scope, but NOT after the > function has > > exited; I should have the option of accessing the enclosing scope, but at > the cost > > of making my delegate not a closure. > > It seems a

Re: first git commit

2011-01-24 Thread Andrew Wiley
On Mon, Jan 24, 2011 at 11:01 AM, Russel Winder wrote: > On Mon, 2011-01-24 at 15:37 +, Iain Buclaw wrote: > [ . . . ] > > What do we have to do with this? I don't think we have much to gain from > moving > > to git. It's not likely to have much effect on the level of interest > people have >

Re: Showing unittest in documentation (Was Re: std.unittests [updated] for review)

2011-01-24 Thread Andrew Wiley
On Mon, Jan 24, 2011 at 3:43 PM, Andrei Alexandrescu < seewebsiteforem...@erdani.org> wrote: > On 1/24/11 3:36 PM, Steven Schveighoffer wrote: > >> On Mon, 24 Jan 2011 16:03:24 -0500, Andrei Alexandrescu >> wrote: >> >>> I find documented unittests attractive mainly because they're >>> _simple_.

Re: Can your programming language do this?

2011-01-25 Thread Andrew Wiley
On Tue, Jan 25, 2011 at 9:48 AM, Adam Ruppe wrote: > Piotr Szturmaj wrote: > > I already have working postgresql row querying. There are typed and > > untyped rows. Untyped row is DBRow!(Variant[]), typed rows are > > encapsulated using struct or tuple, for example: > > Very nice! I did something

Re: Smartphones and D

2011-01-30 Thread Andrew Wiley
On Sun, Jan 30, 2011 at 7:52 AM, Denis Koroskin <2kor...@gmail.com> wrote: > On Sun, 30 Jan 2011 16:23:21 +0300, Trass3r wrote: > > That said I really hope D gets an ARM backend. While it isn't likely for a >>> DMD to happen, it could for LDC. >>> >> >> As I said in my other answer to this topic

Re: Smartphones and D

2011-01-30 Thread Andrew Wiley
On Sun, Jan 30, 2011 at 2:05 AM, Gary Whatmore wrote: > jim_g Wrote: > > > What I tried to say is, in my opinion, a language with only a half or a > quarter of D's improvements over C++ would be more successful on > smartphone/tablet platforms than yet another x86 oriented language, no > matter h

Re: Smartphones and D

2011-01-30 Thread Andrew Wiley
On Sun, Jan 30, 2011 at 2:30 AM, Gary Whatmore wrote: > Jonathan M Davis Wrote: > > > On Sunday 30 January 2011 00:05:59 Gary Whatmore wrote: > > > jim_g Wrote: > > > > What I tried to say is, in my opinion, a language with only a half or > a > > > > quarter of D's improvements over C++ would be

Re: Smartphones and D

2011-01-31 Thread Andrew Wiley
On Mon, Jan 31, 2011 at 5:51 AM, Daniel Gibson wrote: > Am 31.01.2011 11:52, schrieb retard: > > Sun, 30 Jan 2011 19:36:44 +0100, Daniel Gibson wrote: >> >> Am 30.01.2011 13:29, schrieb Michel Fortin: >>> On 2011-01-30 03:05:59 -0500, Gary Whatmore said: D's main focus currently

Re: Calling method by name.

2011-02-03 Thread Andrew Wiley
On Thu, Feb 3, 2011 at 10:07 PM, Jonathan M Davis wrote: > On Thursday 03 February 2011 19:29:15 Robert Jacques wrote: > > On Thu, 03 Feb 2011 08:49:54 -0500, Jacob Carlborg wrote: > > > On 2011-02-03 05:52, Robert Jacques wrote: > > >> On Wed, 02 Feb 2011 12:55:37 -0500, %u wrote: > > >>> I kno

Re: Catching a hot potato

2011-10-16 Thread Andrew Wiley
On Sun, Oct 16, 2011 at 11:54 PM, Gor Gyolchanyan < gor.f.gyolchan...@gmail.com> wrote: > If the user tries to read unallocated memory, the memory can't > possibly get corrupted, since nothing is getting changed. > If the user tried to write to unallocated memory, the segfault should > _prevent_ i

Re: Catching a hot potato

2011-10-16 Thread Andrew Wiley
On Mon, Oct 17, 2011 at 12:37 AM, Andrew Wiley wrote: > On Sun, Oct 16, 2011 at 11:54 PM, Gor Gyolchanyan < > gor.f.gyolchan...@gmail.com> wrote: > >> If the user tries to read unallocated memory, the memory can't >> possibly get corrupted, since nothing is getti

Shared Delegates

2011-10-17 Thread Andrew Wiley
Okay, I realize there have been some discussions about this, but I have a few questions about shared delegates because right now they are definitely broken, but I'm not sure how. Take this code example: synchronized class Thing { void doSomeWork(void delegate() work) { work

Re: Shared Delegates

2011-10-17 Thread Andrew Wiley
On Tue, Oct 18, 2011 at 12:53 AM, Benjamin Thaut wrote: > Am 17.10.2011 22:43, schrieb Michel Fortin: > > On 2011-10-17 20:33:59 +0000, Andrew Wiley >> said: >> >> >>> Okay, I realize there have been some discussions about this, but I have a >>>

Re: Shared Delegates

2011-10-17 Thread Andrew Wiley
On Tue, Oct 18, 2011 at 1:11 AM, Benjamin Thaut wrote: > Am 18.10.2011 08:03, schrieb Andrew Wiley: > >> On Tue, Oct 18, 2011 at 12:53 AM, Benjamin Thaut > <mailto:c...@benjamin-thaut.de**>> wrote: >> >>Am 17.10.2011 22:43, schrieb Michel Fortin: >&

Re: Shared Delegates

2011-10-18 Thread Andrew Wiley
On Tue, Oct 18, 2011 at 1:48 AM, Andrew Wiley wrote: > On Tue, Oct 18, 2011 at 1:11 AM, Benjamin Thaut wrote: > >> Am 18.10.2011 08:03, schrieb Andrew Wiley: >> >>> On Tue, Oct 18, 2011 at 12:53 AM, Benjamin Thaut >> <mailto:c...@benjamin-thaut.de**>

Re: Shared Delegates

2011-10-19 Thread Andrew Wiley
On Mon, Oct 17, 2011 at 3:43 PM, Michel Fortin wrote: > On 2011-10-17 20:33:59 +0000, Andrew Wiley > said: > > >> Okay, I realize there have been some discussions about this, but I have a >> few questions about shared delegates because right now they are definitely >

Re: Shared Delegates

2011-10-19 Thread Andrew Wiley
On Wed, Oct 19, 2011 at 4:11 PM, Michel Fortin wrote: > On 2011-10-19 20:36:37 +0000, Andrew Wiley > said: > > >> On Mon, Oct 17, 2011 at 3:43 PM, Michel Fortin > >**wrote: >> >> On 2011-10-17 20:33:59 +, Andrew Wiley >>> said: >>> >

Re: Shared Delegates

2011-10-19 Thread Andrew Wiley
On Wed, Oct 19, 2011 at 9:38 PM, Robert Jacques wrote: > On Wed, 19 Oct 2011 20:51:25 -0400, Michel Fortin < > michel.for...@michelf.com> wrote: > >> On 2011-10-19 21:53:12 +, Andrew Wiley >> said: >> > > [snip] > > Also, I how shared

Is This a Bug

2011-10-24 Thread Andrew Wiley
Is this a bug, or is my understanding of shared/synchronized still broken: module test; synchronized class Bob { private: int _i; invariant() { // test.d(7): Error: function test.Bob.__invariant () shared is not callable using argument types () assert(_i == 5); } public: this() { _i = 5; } @p

Another Shared Bug?

2011-10-24 Thread Andrew Wiley
My understanding is that this: module test2; synchronized abstract class Bob { private: int _i = 2; public: @property int i() { return _i; } } synchronized class Bill : Bob { public: @property int thing() { return i; } } should be the same as this: module test2; syn

Re: Phobos 'collections' question

2011-10-24 Thread Andrew Wiley
On Mon, Oct 24, 2011 at 9:50 PM, Marco Leise wrote: > Am 14.09.2011, 18:57 Uhr, schrieb Steven Schveighoffer < > schvei...@yahoo.com>: > > > On Wed, 14 Sep 2011 12:50:25 -0400, Timon Gehr wrote: >> >> On 09/14/2011 04:08 PM, Robert McGinley wrote: >>> Hey all, Mostly as an exercise I

Synchronized Classes and Struct Members

2011-10-24 Thread Andrew Wiley
Geez, I try to write some multithreaded code and I just keep hitting these: module test3; struct SomeData { int i; int iPlus2() { return i + 2; } } synchronized class Bob { private: SomeData _dat; public: this() { _dat.i = 3; } @property int i() { return _dat.iPlus2(); // test3.d(2

Re: Synchronized Classes and Struct Members

2011-10-24 Thread Andrew Wiley
On Tue, Oct 25, 2011 at 1:26 AM, Benjamin Thaut wrote: > Am 25.10.2011 08:06, schrieb Andrew Wiley: > > Geez, I try to write some multithreaded code and I just keep hitting >> these: >> >> module test3; >> >> struct SomeData { >

Re: Synchronized Classes and Struct Members

2011-10-25 Thread Andrew Wiley
On Tue, Oct 25, 2011 at 8:06 AM, Gor Gyolchanyan < gor.f.gyolchan...@gmail.com> wrote: > And so you can have both thread-safe synchronized heavy-duty container > and a fast and small container all in one just by overloading the > appropriate methods and adding appropriate synchronization blocks in

Re: Synchronized Classes and Struct Members

2011-10-25 Thread Andrew Wiley
On Tue, Oct 25, 2011 at 11:59 AM, Timon Gehr wrote: > On 10/25/2011 06:24 PM, Andrew Wiley wrote: > >> >> >> On Tue, Oct 25, 2011 at 8:06 AM, Gor Gyolchanyan >> > <mailto:gor.f.gyolchanyan@**gmail.com>> >> wrote: >> >>And so you

Re: core.cpuid

2011-10-29 Thread Andrew Wiley
On Sat, Oct 29, 2011 at 10:55 PM, Chante wrote: > > "Manu" wrote in message > news:mailman.586.1319935753.24802.digitalmar...@puremagic.com... > > > What's the deal with core.cpuid? > > I think they just want the "mainstream" > ("sheeple"/"followers"/"believers"/"90210_ers"/"younsters", etc.). I

Common Issue in Shared Code

2011-11-20 Thread Andrew Wiley
About a month or so ago, I started trying to convert a codebase I've been working on into a multithreaded system, and I've been hitting this sort of thing over and over: // used as a field and as a local variable all over the codebase struct Data { int a,b,c; int total() { return a + b +

Re: Common Issue in Shared Code

2011-11-20 Thread Andrew Wiley
Gah, looks like I accidentally sent this as an HTML message, and the web newsreader stripped out part of the sample code ( http://digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=149624 ) Here's the message again in plain text: About a month or so ago, I started trying to

Immutable Message Passing

2011-12-03 Thread Andrew Wiley
This should work, right? I'm not just going crazy or something? import std.concurrency; import std.stdio; class Bob { } void main() { auto tid = spawn(&b); tid.send(new immutable(Bob)()); } void b() { receive( (immutable(Bob) b) { writeln("got it"); }

Re: Immutable Message Passing

2011-12-04 Thread Andrew Wiley
On Sun, Dec 4, 2011 at 1:42 AM, Jonathan M Davis wrote: > On Sunday, December 04, 2011 01:24:02 Andrew Wiley wrote: >> This should work, right? I'm not just going crazy or something? >> >> import std.concurrency; >> import std.stdio; >> >> class Bo

Re: Immutable Message Passing

2011-12-04 Thread Andrew Wiley
On Sun, Dec 4, 2011 at 2:46 PM, Andrew Wiley wrote: > On Sun, Dec 4, 2011 at 1:42 AM, Jonathan M Davis wrote: >> On Sunday, December 04, 2011 01:24:02 Andrew Wiley wrote: >>> This should work, right? I'm not just going crazy or something? >>> >>> imp

Re: Immutable Message Passing

2011-12-04 Thread Andrew Wiley
On Sun, Dec 4, 2011 at 4:23 PM, Andrei Alexandrescu wrote: > On 12/4/11 4:16 PM, Andrew Wiley wrote: >> >> So it looks like right now, message passing is copying objects, which >> seems very bad. Check this out: >> >> import std.stdio; >>

Re: Immutable Message Passing

2011-12-04 Thread Andrew Wiley
On Sun, Dec 4, 2011 at 6:19 PM, Timon Gehr wrote: > On 12/04/2011 11:32 PM, Andrew Wiley wrote: >> >> On Sun, Dec 4, 2011 at 4:23 PM, Andrei Alexandrescu >>  wrote: >>> >>> On 12/4/11 4:16 PM, Andrew Wiley wrote: >>> >>>> >>>&g

Re: Immutable Message Passing

2011-12-05 Thread Andrew Wiley
On Sun, Dec 4, 2011 at 9:12 PM, Andrei Alexandrescu wrote: > On 12/4/11 4:32 PM, Andrew Wiley wrote: >> >> In that case, no object copying is occurring, and I have message >> passing for immutable objects working, although my current solution is >> basically to

Re: What would you do...

2011-12-08 Thread Andrew Wiley
On Thu, Dec 8, 2011 at 5:53 PM, Sean Kelly wrote: > On Dec 8, 2011, at 8:23 AM, Manu wrote: >> >> Just digging through concurrence.d since the docs are pretty bare, and I've >> come across this pattern, which raises a pretty worrying alarm to me. I >> wonder if this is common in D libraries... >

Re: What would you do... -> Extending std.concurrency

2011-12-08 Thread Andrew Wiley
On Thu, Dec 8, 2011 at 7:12 PM, Sean Kelly wrote: > On Dec 8, 2011, at 4:13 PM, Andrew Wiley wrote: >> >> This is somewhat of a threadjack, but I was looking at making a >> lighter actor-like abstraction for message passing, and possibly >> making it compatible with

Templated Struct Constructor

2011-12-09 Thread Andrew Wiley
Is there a syntax that allows me to specify arguments to a templated constructor for a struct? The intuitive way looks like this, but it doesn't work. --- struct Test { this(T, bool b)(T info) if((b && something ) || (!b && somethingElse)) { } } void main() {

Re: Templated Struct Constructor

2011-12-09 Thread Andrew Wiley
On Sat, Dec 10, 2011 at 1:23 AM, Andrew Wiley wrote: > Is there a syntax that allows me to specify arguments to a templated > constructor for a struct? The intuitive way looks like this, but it > doesn't work. > > --- > struct Test { >        this(T, bool b)(T info) i

Re: Templated Struct Constructor

2011-12-10 Thread Andrew Wiley
On Sat, Dec 10, 2011 at 5:38 AM, Trass3r wrote: >> Looks like I can work around it by doing this: >> --- >> template makeTest(T, bool b) { >>    static if((b && something) || (!b && somethingElse)) { >>        alias Test makeTest; >>    } >>    else static assert(0, "some error message"); >> } >>

Re: If I had my way

2011-12-10 Thread Andrew Wiley
On Sat, Dec 10, 2011 at 2:00 PM, David Nadlinger wrote: > I certainly appreciate the general statement, as keeping ones users happy is > one of the most important, if not the single most important thing, to a > positive image. > > However, please don't forget that there has already been put quite

Null and IFTI

2011-12-10 Thread Andrew Wiley
--- class Bob { } void doSomething(T)(Bob bob, T data) { } void main() { doSomething(null, 5); // Error: template test.doSomething(T) does not match any function template declaration // Error: template test.doSomething(T) cannot deduce template function from argument types !()(voi

Re: Null and IFTI

2011-12-11 Thread Andrew Wiley
On Sun, Dec 11, 2011 at 10:00 AM, Andrei Alexandrescu wrote: > On 12/11/11 6:05 AM, kenji hara wrote: >> >> 2.057 will compile this code, because it adds the new feature. >> Now null literal has the type that is expressed as typeof(null), not >> void*. >> And typeof(null) is derived from all class

Re: Sitemap

2011-12-12 Thread Andrew Wiley
On Mon, Dec 12, 2011 at 4:09 PM, Andrei Alexandrescu wrote: > On 12/12/11 2:06 PM, Peter Alexander wrote: >> >> On 12/12/11 7:52 PM, Andrei Alexandrescu wrote: >>> >>> I've added a sitemap to the website: >>> >>> http://dlang.org/sitemap.html >>> >>> I've already removed a bunch of obsolete docume

Re: Bug Prediction at Google

2011-12-15 Thread Andrew Wiley
On Thu, Dec 15, 2011 at 6:04 PM, Robert Clipsham wrote: > I just read this pretty interesting article on the Google Engineering Tools > website, thought it might interest some people here: > > http://google-engtools.blogspot.com/2011/12/bug-prediction-at-google.html > > ( http://goo.gl/2O6YT <= a

@disabled Propagating to Classes?

2011-12-16 Thread Andrew Wiley
Is this a bug? ``` struct SomeStruct { @disable this(); this(int arg) { } } class SomeClass { private: SomeStruct _stuff; public: this() { _stuff = SomeStruct(10); } } void someFunc() { SomeClass obj

Re: @disabled Propagating to Classes?

2011-12-16 Thread Andrew Wiley
On Fri, Dec 16, 2011 at 2:28 PM, Timon Gehr wrote: > On 12/16/2011 09:20 PM, Andrew Wiley wrote: >> >> Is this a bug? >> >> ``` >> struct SomeStruct { >>        @disable this(); >>        this(int arg) { >>        } >> } >> >

Double Checked Locking

2011-12-16 Thread Andrew Wiley
I was looking through Jonathan Davis's pull request to remove static constructors from std.datetime, and I realized that I don't know whether Double Checked Locking is legal under D's memory model, and what the requirements for it to work would be. (if you're not familiar with the term, check out h

Re: Double Checked Locking

2011-12-16 Thread Andrew Wiley
On Sat, Dec 17, 2011 at 1:47 AM, Andrew Wiley wrote: > I was looking through Jonathan Davis's pull request to remove static > constructors from std.datetime, and I realized that I don't know > whether Double Checked Locking is legal under D's memory model, and > what

Re: d future or plans for d3

2011-12-18 Thread Andrew Wiley
On Sun, Dec 18, 2011 at 6:19 AM, Alex Rønne Petersen wrote: > On 18-12-2011 12:45, Somedude wrote: >> >> Le 18/12/2011 12:13, Ruslan Mullakhmetov a écrit : >>> >>>  I do not want to make a flame over D vs C++11. >>> >>> ... >>>  Once again, i'm not trying to make a holywar. I'm D lover myself. But

Re: d future or plans for d3

2011-12-18 Thread Andrew Wiley
On Sun, Dec 18, 2011 at 5:55 PM, Timon Gehr wrote: > On 12/19/2011 12:45 AM, Vladimir Panteleev wrote: >> >> On Sunday, 18 December 2011 at 23:31:03 UTC, Timon Gehr wrote: >>> >>> On 12/19/2011 12:24 AM, Vladimir Panteleev wrote: On Sunday, 18 December 2011 at 23:18:22 UTC, Timon Gehr wr

Re: Java > Scala

2011-12-18 Thread Andrew Wiley
On Sun, Dec 18, 2011 at 3:14 PM, Paulo Pinto wrote: > so Wrote: > >> On Sun, 18 Dec 2011 22:08:54 +0200, Paulo Pinto >> wrote: >> >> > The SunSpot VM is written in Java with a very small subset of C code. >> > http://www.sunspotworld.com >> > http://labs.oracle.com/projects/squawk/squawk-rjvm.htm

Re: Bugzilla patches

2011-12-18 Thread Andrew Wiley
On Sun, Dec 18, 2011 at 11:00 PM, Walter Bright wrote: > I'm looking for volunteers to convert all the remaining patches in Bugzilla > to pull requests. I could take a crack at it, although if you're going to do that, why not move the issue tracking to Github as well and take advantage of the int

Get a Reference to an Object's Monitor

2011-12-20 Thread Andrew Wiley
Is there any way to get a reference to an object's monitor? This would be very useful because a Condition has to be tied to a Mutex, and since objects already have a reference to a Mutex built in, it doesn't make much sense to create another (and add another reference to the class) when the end eff

Re: Get a Reference to an Object's Monitor

2011-12-20 Thread Andrew Wiley
On Tue, Dec 20, 2011 at 2:29 PM, bearophile wrote: > Andrew Wiley: > >> Is there any way to get a reference to an object's monitor? > > Is this useful? From the D2 docs: > >> The properties .__vptr and .__monitor give access to the class object's >&g

Re: Get a Reference to an Object's Monitor

2011-12-20 Thread Andrew Wiley
On Tue, Dec 20, 2011 at 3:40 PM, bearophile wrote: > Andrew Wiley: > >> I suspect the reason they advise not using it in user code is that the >> monitor is lazily initialized (if I remember correctly), so I'd have >> to initialize it myself. > > I see. It lo

Re: Get a Reference to an Object's Monitor

2011-12-20 Thread Andrew Wiley
On Tue, Dec 20, 2011 at 9:16 PM, Sean Kelly wrote: > Yup. > Do you have any plans to eliminate the fun things like (cast()condition).wait(); ? It seems like most of the classes in core.sync should be declared as shared classes. I realize there would be code breakage, but having to cast away shar

Templated Struct Constructors

2011-12-21 Thread Andrew Wiley
Is this a bug, or are templated struct constructors not allowed to call other constructors? --- struct A { this(T)(T thing, int i) { this(thing, i > 0); // Error: constructor call must be in a constructor } this(T)(T thing, bool b) { } } void main() { auto a = A(5, 5);

Re: Templated Struct Constructors

2011-12-21 Thread Andrew Wiley
On Wed, Dec 21, 2011 at 10:32 PM, kenji hara wrote: > Please file it into bugzilla, because it is a bug. > I'll post a patch to fix it. > > Kenji Hara > Filed: http://d.puremagic.com/issues/show_bug.cgi?id=7150 Thanks!

Some Issues With Synchronized

2011-12-22 Thread Andrew Wiley
I'm having some issues getting the synchronized modifier to work like a synchronized block. Sorry this code example is long, but here's three dummy implementations of a Condition-based work queue: ---import std.stdio; import core.sync.mutex; import core.sync.condition; import core.thread; synchro

Synchronized Class Constructors (Was: Re: Some Issues With Synchronized)

2011-12-22 Thread Andrew Wiley
Alright, looks like my code examples were too long (see Some Issues With Synchronized), but I've found an issue with synchronized that I think might be a bug (or a design bug). In simple terms, constructors for synchronized classes are synchronized. This should rarely cause problems, but it's unnec

Re: Some Issues With Synchronized

2011-12-23 Thread Andrew Wiley
On Fri, Dec 23, 2011 at 1:25 AM, Somedude wrote: > On windows XP with DMD 2.057, I get > Queue1: deadlock > Queue2: works > Queue3: works Yes, I posted another (much shorter) post describing the issue with Queue1. In short, since Queue1 is a synchronized class, the constructor is synchronized (wh

Re: Some Issues With Synchronized

2011-12-23 Thread Andrew Wiley
On Fri, Dec 23, 2011 at 8:33 PM, Andrew Wiley wrote: > On Fri, Dec 23, 2011 at 1:25 AM, Somedude wrote: >> On windows XP with DMD 2.057, I get >> Queue1: deadlock >> Queue2: works >> Queue3: works > > Yes, I posted another (much shorter) post describing the iss

Re: Raspberry Pi - raspberrypi.org

2011-12-23 Thread Andrew Wiley
On Fri, Dec 23, 2011 at 11:10 PM, Steve Teale wrote: > Now here's an interesting target for D - this little beast could sell in > millions, and could be the way that many youngsters start out as > programmers. > > Presumably LDC would be the quickest thing to get on there? > > Steve GDC on ARM ha

Re: Raspberry Pi - raspberrypi.org

2011-12-24 Thread Andrew Wiley
On Sat, Dec 24, 2011 at 9:51 AM, Jacob Carlborg wrote: > On 2011-12-24 08:26, Andrew Wiley wrote: >> >> On Fri, Dec 23, 2011 at 11:10 PM, Steve Teale >>  wrote: >>> >>> Now here's an interesting target for D - this little beast could sell in >

Re: Could we use something better than zip for the dmd package?

2011-12-24 Thread Andrew Wiley
On Sat, Dec 24, 2011 at 9:18 AM, Jacob Carlborg wrote: > On 2011-12-23 22:38, Somedude wrote: >> >> Le 23/12/2011 18:11, Nick Sabalausky a écrit : >>> >>> >>> I'm actually inching closer to being a linux guy. Being able to easily >>> script just about everything is pretty nice, and after Vista, Wi

Re: Raspberry Pi - raspberrypi.org

2011-12-24 Thread Andrew Wiley
On Sat, Dec 24, 2011 at 10:04 PM, Alex Rønne Petersen wrote: > On 24-12-2011 17:20, Andrew Wiley wrote: >> >> On Sat, Dec 24, 2011 at 9:51 AM, Jacob Carlborg  wrote: >>> >>> On 2011-12-24 08:26, Andrew Wiley wrote: >>> >>>> >>>

Re: versions and 32 vs 64-bit code

2011-12-26 Thread Andrew Wiley
On Mon, Dec 26, 2011 at 3:53 AM, Alex Rønne Petersen wrote: > On 26-12-2011 06:41, Nathan Coe wrote: >> >> Is there a way to change what is compiled in based on whether the -m32 or >> -m64 >> option is chosen? I can see that there are predefined versions (for X86 >> and >> X86_64 e.g.), but I don'

Re: *sigh*

2011-12-27 Thread Andrew Wiley
On Tue, Dec 27, 2011 at 1:56 AM, Caligo wrote: > At the moment I don't see how anything serious can be done with D.  In the > past few weeks, while working on a _toy_ project, I've encountered several > bugs that have caused a lot of problems and wasted a lot of time.  Sorry, > but it's just frust

Re: CURL Wrapper: Congratulations Next up: std.serialize

2011-12-31 Thread Andrew Wiley
On Sat, Dec 31, 2011 at 2:56 PM, Jonathan M Davis wrote: > On Saturday, December 31, 2011 16:06:49 Jacob Carlborg wrote: >> On 2011-12-31 11:37, Jonathan M Davis wrote: >> > On Saturday, December 31, 2011 11:05:58 Tobias Pankrath wrote: >> >>> I think that the AssertError's message (which includes

Re: Multiple return values

2012-01-03 Thread Andrew Wiley
On Tue, Jan 3, 2012 at 6:48 PM, bearophile wrote: > Jonathan M Davis: > >> I'm not saying anything about the value of the feature. I'm just saying that >> given D's lineage, it's not at all suprising that it doesn't support multiple >> return values. In fact, it would be very abnormal if it did. T

Re: Some Issues With Synchronized

2012-01-04 Thread Andrew Wiley
On Wed, Jan 4, 2012 at 2:12 PM, Sean Kelly wrote: > On Dec 23, 2011, at 8:49 PM, Andrew Wiley wrote: > >> On Fri, Dec 23, 2011 at 8:33 PM, Andrew Wiley >> wrote: >>> On Fri, Dec 23, 2011 at 1:25 AM, Somedude >>> wrote: >>>> On windows XP with DM

  1   2   3   >