Re: Minimal port of xfbuild to D2

2012-02-21 Thread Andrej Mitrovic
Yeah my port is very much still alpha. I don't yet know what to do about the fact that parallel builds are awfully broken. xfBuild uses associative arrays and modifies them on-the-fly in multiple threads, and this causes synchronization issues. To be fair, at the time I didn't really know that

Re: D forums now live!

2012-02-21 Thread Kagamin
On Tuesday, 21 February 2012 at 00:53:51 UTC, James Miller wrote: There are a potentially infinite number of possible configurations, and sites need to be aimed at the lowest-common denominator. Doesn't look right with an enlarged font size? Tough. So the joke about standard font size isn't

Re: Programming in D book, Parallelism chapter

2012-02-21 Thread David
You mentioned tasks, what I was missing a bit is taskPool.put, since Task.executeInNewThread creates a new internal Pool, which is not what always want. Then would be interesting how you check, if the pool's tasks have all finished (I didnt find any method doing this, to emulate this, I used

Re: Minimal port of xfbuild to D2

2012-02-21 Thread Andrej Mitrovic
On 2/21/12, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: To be fair, at the time I didn't really know that Tango was going to be ported to D2 and that it will work well. Actually I just wasn't paying attention, Tango for D2 was released before I did the port. Heh.

Re: D forums now live!

2012-02-21 Thread James Miller
On 21 February 2012 23:29, Kagamin s...@here.lot wrote: On Tuesday, 21 February 2012 at 00:53:51 UTC, James Miller wrote: There are a potentially infinite number of possible configurations, and sites need to be aimed at the lowest-common denominator. Doesn't look right with an enlarged font

Re: CWrap - higher abstraction level for calling C functions

2012-02-21 Thread Gour
On Mon, 20 Feb 2012 20:52:04 +0100 Jacob Carlborg d...@me.com wrote: As I understand it, CWrap provides more than just bindings for a C function. Right, but, afaik, SWIG can also make more than wrapper for a C function by using typemaps, %exception etc. Does it mean that dstep is only tool

Re: D forums now live!

2012-02-21 Thread Vladimir Panteleev
On Tuesday, 21 February 2012 at 00:53:51 UTC, James Miller wrote: Doesn't look right with an enlarged font size? Tough. It's a question of gain per effort. Issues due to non-standard font sizes seem to come up often enough to warrant investigating, and I admit I've completely disregarded

Re: Programming in D book, Parallelism chapter

2012-02-21 Thread Ali Çehreli
On 02/21/2012 03:03 AM, David wrote: You mentioned tasks, what I was missing a bit is taskPool.put, Thank you David. I will add the rest of the TaskPool member functions. since Task.executeInNewThread creates a new internal Pool, which is not what always want. Then would be interesting how

Re: CWrap - higher abstraction level for calling C functions

2012-02-21 Thread Jacob Carlborg
On 2012-02-21 13:12, Gour wrote: On Mon, 20 Feb 2012 20:52:04 +0100 Jacob Carlborgd...@me.com wrote: As I understand it, CWrap provides more than just bindings for a C function. Right, but, afaik, SWIG can also make more than wrapper for a C function by using typemaps, %exception etc. Does

Re: D forums now live!

2012-02-21 Thread dbulletin
I can't Private Message you so I'm just going to say it out loud. If you guys are planning a forum software solution. And your emphasis is on d I would buy dBulletin.com It's for sale to the highest bidder. I originally found this domain from this site: http://www.webmarketingtalk.com/ So get

Re: Programming in D book, Parallelism chapter

2012-02-21 Thread David
Am 21.02.2012 18:28, schrieb Ali Çehreli: Good questions for D.learn, where I will learn myself. :) Ali I think I should subscribe to it ;)

GoingNative 6: The D Episode with Walter Bright and Andrei Alexandrescu

2012-02-21 Thread Walter Bright
http://channel9.msdn.com/Shows/C9-GoingNative/GoingNative-6-The-D-Episode-with-Walter-Bright-and-Andrei-Alexandrescu

Re: GoingNative 6: The D Episode with Walter Bright and Andrei Alexandrescu

2012-02-21 Thread Caligo
Thanks Walter. Thanks Andrei. You too, smiley face. On Tue, Feb 21, 2012 at 6:39 PM, Walter Bright newshou...@digitalmars.com wrote: http://channel9.msdn.com/Shows/C9-GoingNative/GoingNative-6-The-D-Episode-with-Walter-Bright-and-Andrei-Alexandrescu

Re: GoingNative 6: The D Episode with Walter Bright and Andrei Alexandrescu

2012-02-21 Thread Piotr Szturmaj
Walter Bright wrote: http://channel9.msdn.com/Shows/C9-GoingNative/GoingNative-6-The-D-Episode-with-Walter-Bright-and-Andrei-Alexandrescu Great talk!

Re: GoingNative 6: The D Episode with Walter Bright and Andrei Alexandrescu

2012-02-21 Thread Juan Manuel Cabo
We want to have many users. dUsers ~= (juanManuel); :-) :-) :-) --jm On 02/21/2012 09:39 PM, Walter Bright wrote: http://channel9.msdn.com/Shows/C9-GoingNative/GoingNative-6-The-D-Episode-with-Walter-Bright-and-Andrei-Alexandrescu

Re: D forums now live!

2012-02-21 Thread Nick Sabalausky
James Miller ja...@aatch.net wrote in message news:mailman.775.1329824618.20196.digitalmars-d-annou...@puremagic.com... I completely agree. And it's hell for you when you're forced to support IE because more than 50% of the customers use IE. if I have to type !--[if IE 6] ever again it will

Re: GoingNative 6: The D Episode with Walter Bright and Andrei Alexandrescu

2012-02-21 Thread Caligo
I thought GDC was going to be part of GCC 4.7, but Andrei in the video said 4.8. That's another year, :-( On Tue, Feb 21, 2012 at 6:39 PM, Walter Bright newshou...@digitalmars.com wrote:

Re: D forums now live!

2012-02-21 Thread Adam D. Ruppe
On Wednesday, 22 February 2012 at 02:12:54 UTC, Nick Sabalausky wrote: Plus, it's a pain to have multiple versions of IE installed (if You don't need it! IE's compatibility mode is very good, including emulating old bugs. If you turn on compatibility mode you can tell pretty well if your site

Re: D forums now live!

2012-02-21 Thread Nick Sabalausky
dbulletin dbulle...@gmail.com wrote in message news:nvmhanxzfuqgnrrji...@forum.dlang.org... I can't Private Message you so I'm just going to say it out loud. If you guys are planning a forum software solution. And your emphasis is on d I would buy dBulletin.com It's for sale to the highest

Re: D forums now live!

2012-02-21 Thread Adam D. Ruppe
On Wednesday, 22 February 2012 at 02:21:22 UTC, Nick Sabalausky wrote: Really? I didn't know there was such a thing. Is this a setting in one of the (*cough*increasingly hidden*cough*) options screens, or something you add to the HTML? You can get it both ways. X-UA-Compatible in html (or

Re: GoingNative 6: The D Episode with Walter Bright and Andrei Alexandrescu

2012-02-21 Thread Andrei Alexandrescu
On 2/21/12 6:39 PM, Walter Bright wrote: http://channel9.msdn.com/Shows/C9-GoingNative/GoingNative-6-The-D-Episode-with-Walter-Bright-and-Andrei-Alexandrescu On reddit: http://www.reddit.com/r/programming/comments/q09su/c9goingnative_6_the_d_episode_with_walter_bright/ Andrei

Re: GoingNative 6: The D Episode with Walter Bright and Andrei Alexandrescu

2012-02-21 Thread Nick Sabalausky
Walter Bright newshou...@digitalmars.com wrote in message news:ji1dfl$17ha$1...@digitalmars.com... http://channel9.msdn.com/Shows/C9-GoingNative/GoingNative-6-The-D-Episode-with-Walter-Bright-and-Andrei-Alexandrescu Great video. It's espcially nice to see an entire one of these videos

Re: D forums now live!

2012-02-21 Thread Jacob Carlborg
On 2012-02-22 03:11, Nick Sabalausky wrote: James Millerja...@aatch.net wrote in message news:mailman.775.1329824618.20196.digitalmars-d-annou...@puremagic.com... I completely agree. And it's hell for you when you're forced to support IE because more than 50% of the customers use IE. if I

Re: Questions about windows support

2012-02-21 Thread Paulo Pinto
You need to enable it. H. S. Teoh wrote in message news:mailman.748.1329787800.20196.digitalmar...@puremagic.com... On Mon, Feb 20, 2012 at 06:38:47PM -0600, Andrei Alexandrescu wrote: On 2/20/12 6:25 PM, Adam D. Ruppe wrote: On Tuesday, 21 February 2012 at 00:19:47 UTC, Jonathan M Davis

Re: Questions about windows support

2012-02-21 Thread Paulo Pinto
Many only know the UNIX version of Linux or BSD, but lets not forget the idiosyncrasies any developer faces when having to support multiple commercial UNIX systems in spite of standards like POSIX. I still remember the first time I loggeded into an HP-UX system in a production system at one

Re: D autocomplete

2012-02-21 Thread Jacob Carlborg
On 2012-02-20 21:23, James Miller wrote: On 21 February 2012 09:02, Jacob Carlborgd...@me.com wrote: On 2012-02-20 17:17, Daniel Murphy wrote: H. S. Teohhst...@quickfur.ath.cxwrote in message news:mailman.667.1329753569.20196.digitalmar...@puremagic.com... I've suggested before, and

Re: Questions about windows support

2012-02-21 Thread Paulo Pinto
They did, but Microsoft way as usual. SSH in Windows, means making use of Powershell remote access. SSH is only meant for UNIX compatibility and it works better if SUA (UNIX personality) is also installed. -- Paulo Andrei Alexandrescu wrote in message

Towards a better conceptual model of exceptions (Was: Re: The Right Approach to Exceptions)

2012-02-21 Thread H. S. Teoh
All of this heated debate has led me to reconsider our whole concept of exceptions. It seems that we're squabbling over little details in existing paradigms. But what of the big picture? What *is* an exception anyway? We all know the textbook definition, but clearly something is missing since we

Re: The Right Approach to Exceptions

2012-02-21 Thread Jacob Carlborg
On 2012-02-20 21:25, Nick Sabalausky wrote: H. S. Teohhst...@quickfur.ath.cx wrote in message news:mailman.704.1329767254.20196.digitalmar...@puremagic.com... On Mon, Feb 20, 2012 at 08:36:56PM +0100, Andrej Mitrovic wrote: On 2/20/12, Juan Manuel Cabojuanmanuel.c...@gmail.com wrote: will

Re: size_t + ptrdiff_t

2012-02-21 Thread Artur Skawina
On 02/21/12 04:12, James Miller wrote: If the only problem is that we need some more types, can't we add them in? I don't see the problem with having verbose, import-only names for things outside the norm, alias them if you want, longer names are better for newcomers. For example, what is

Re: no matching function for call to ‘Type::d efaultInitLiteral()’?

2012-02-21 Thread kennytm
Andre Tampubolon an...@lc.vlsm.org wrote: I just fetched the latest source code, and when I was trying to build dmd, I got this: func.c: In member function ‘MATCH FuncDeclaration::leastAsSpecialized(FuncDeclaration*)’: func.c:2493:45: error: no matching function for call to

Re: Questions about windows support

2012-02-21 Thread Manu
On 21 February 2012 01:00, H. S. Teoh hst...@quickfur.ath.cx wrote: On Mon, Feb 20, 2012 at 05:25:28PM -0500, Jonathan M Davis wrote: On Monday, February 20, 2012 22:36:49 Benjamin Thaut wrote: 1) Is there a chance that dmd will support 64 bit on windows any time soon? What are the

Re: D autocomplete

2012-02-21 Thread Daniel Murphy
Jacob Carlborg d...@me.com wrote in message news:jhvja0$vkq$1...@digitalmars.com... libclang is awesome, so libdmd should be /more/ awesome, right? -- James Miller Yes, even more awesome, and written in D :) -- /Jacob Carlborg Would be much easier to create and keep in sync if it was

Re: The Right Approach to Exceptions

2012-02-21 Thread dennis luehring
Am 20.02.2012 22:11, schrieb Juan Manuel Cabo: Yeah.. that is a problem! :-) Thanks for liking the idea, now we can talk about the fine details!! One way is to not let the user direct access to the associative array, but wrap the e.info[MyDetail] call in a nothrow function, such as

Re: D autocomplete

2012-02-21 Thread Daniel Murphy
Gor Gyolchanyan gor.f.gyolchan...@gmail.com wrote in message news:mailman.670.1329756860.20196.digitalmar...@puremagic.com... If i recall correctly this is the third thread that ended with we need a D front-end. Making a good front-end will mean a very significant step forward towards a good

Re: Seas of errors from DMD

2012-02-21 Thread Don Clugston
On 20/02/12 22:16, Don wrote: On 19.02.2012 22:35, bearophile wrote: This is a recent fix: http://d.puremagic.com/issues/show_bug.cgi?id=7481 but I suggest to revert it, or improve it significantly, because I am seeing avalanches of error messages, that slow down my compilation-fix-run cycle

no matching function for call to ‘Type::defaultInitLiteral()’?

2012-02-21 Thread Andre Tampubolon
I just fetched the latest source code, and when I was trying to build dmd, I got this: func.c: In member function ‘MATCH FuncDeclaration::leastAsSpecialized(FuncDeclaration*)’: func.c:2493:45: error: no matching function for call to ‘Type::defaultInitLiteral()’ func.c:2493:45: note: candidate

Re: size_t + ptrdiff_t

2012-02-21 Thread Manu
On 21 February 2012 01:22, Walter Bright newshou...@digitalmars.com wrote: On 2/20/2012 3:28 AM, Manu wrote: Even size_t is often broken in C. I have worked on 64bit systems with 32bit pointers where size_t was still 64bit, but ptrdiff_t was 32bit (I think PS3 is like this, but maybe my

Re: The Right Approach to Exceptions

2012-02-21 Thread Andrej Mitrovic
On 2/20/12, H. S. Teoh hst...@quickfur.ath.cx wrote: Actually, even that isn't ideal. How is the translator to know what on earth {0} and {1} are? Sorry, I didn't mean this in the concept of exceptions but generally when calling writefln format. This exceptions thread has exploded so fast I

Re: Towards a better conceptual model of exceptions (Was: Re: The Right Approach to Exceptions)

2012-02-21 Thread dennis luehring
Am 21.02.2012 09:15, schrieb H. S. Teoh: Sorry for this super-long post perfect length, helps to clean the brain and focus on the real problems again

Re: The Right Approach to Exceptions

2012-02-21 Thread Jacob Carlborg
On 2012-02-21 01:51, H. S. Teoh wrote: On Mon, Feb 20, 2012 at 06:19:32PM -0600, Andrei Alexandrescu wrote: On 2/20/12 5:46 PM, Nick Sabalausky wrote: [...] You've suggested adding Variant[string] info to Exception for the sake of i18n. I think that's what he's referring to. You *could* argue

Re: The Right Approach to Exceptions

2012-02-21 Thread deadalnix
Le 20/02/2012 21:57, Andrei Alexandrescu a écrit : On 2/20/12 1:45 PM, Jonathan M Davis wrote: On Monday, February 20, 2012 20:42:28 deadalnix wrote: Le 20/02/2012 20:27, Jonathan M Davis a écrit : On Monday, February 20, 2012 11:15:08 H. S. Teoh wrote: That's why I proposed to use runtime

Re: The Right Approach to Exceptions

2012-02-21 Thread Vincent
On Saturday, 18 February 2012 at 18:52:05 UTC, Andrei Alexandrescu wrote: From experience I humbly submit that catching by type is most of the time useless. Completely disagree. Types allow to control place for catch. Say, some deeply nested function catches its own exceptions, while outer

Re: The Right Approach to Exceptions

2012-02-21 Thread foobar
On Tuesday, 21 February 2012 at 02:23:58 UTC, Andrei Alexandrescu wrote: On 2/20/12 7:02 PM, Juan Manuel Cabo wrote: oops, sorry!! I just saw a post by someone named Jose. My thousand apollogies!! I got confused. It was your argument I meant to refer to - adding info to the exception in

Re: Towards a better conceptual model of exceptions (Was: Re: The Right Approach to Exceptions)

2012-02-21 Thread deadalnix
First great post. Don't be sorry, it is insightful. The Condition catgory make a lot of sense to me. Le 21/02/2012 09:15, H. S. Teoh a écrit : Currently, I'm still unsure whether Conditions and Exceptions should be unified, or they should be kept separate; deadalnix recommended they be kept

Re: The Right Approach to Exceptions

2012-02-21 Thread deadalnix
Le 21/02/2012 11:40, Vincent a écrit : On Saturday, 18 February 2012 at 18:52:05 UTC, Andrei Alexandrescu wrote: From experience I humbly submit that catching by type is most of the time useless. Completely disagree. Types allow to control place for catch. Say, some deeply nested function

Custom calling conventions

2012-02-21 Thread Manu
So I was thinking about this extern(language) thing, the obvious ones are supported, but it would be really nice to be able to implement custom conventions for other languages/scripting languages. For instance, I'm thinking about Android, I have JNI binding code everywhere, it's really ugly. I'd

Re: The Right Approach to Exceptions

2012-02-21 Thread Jacob Carlborg
On 2012-02-21 03:34, Andrei Alexandrescu wrote: On 2/20/12 6:51 PM, H. S. Teoh wrote: On Mon, Feb 20, 2012 at 06:19:32PM -0600, Andrei Alexandrescu wrote: On 2/20/12 5:46 PM, Nick Sabalausky wrote: [...] You've suggested adding Variant[string] info to Exception for the sake of i18n. I think

Re: Custom calling conventions

2012-02-21 Thread Gor Gyolchanyan
This is just what I needed. I need to create a new calling convention to implement dynamic data typing without resorting to incredibly slow and cumbersome Variant. On Tue, Feb 21, 2012 at 3:03 PM, Manu turkey...@gmail.com wrote: So I was thinking about this extern(language) thing, the obvious

Re: Seas of errors from DMD

2012-02-21 Thread Don Clugston
On 19/02/12 22:35, bearophile wrote: This is a recent fix: http://d.puremagic.com/issues/show_bug.cgi?id=7481 but I suggest to revert it, or improve it significantly, because I am seeing avalanches of error messages, that slow down my compilation-fix-run cycle and are useless to me and

Re: Custom calling conventions

2012-02-21 Thread Manu
On 21 February 2012 13:19, Gor Gyolchanyan gor.f.gyolchan...@gmail.comwrote: This is just what I needed. I need to create a new calling convention to implement dynamic data typing without resorting to incredibly slow and cumbersome Variant. Umm, I am of course talking about a compile-time

Re: The Right Approach to Exceptions

2012-02-21 Thread Regan Heath
On Sun, 19 Feb 2012 23:04:59 -, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 2/19/12 4:00 PM, Nick Sabalausky wrote: Seriously, how is this not *already* crystal-clear? I feel as if every few weeks you're just coming up with deliberately random shit to argue so the

Re: no matching function for call to ‘Type::d efaultInitLiteral()’?

2012-02-21 Thread Andre Tampubolon
kennytm kenn...@gmail.com wrote: Andre Tampubolon an...@lc.vlsm.org wrote: I just fetched the latest source code, and when I was trying to build dmd, I got this: func.c: In member function ‘MATCH FuncDeclaration::leastAsSpecialized(FuncDeclaration*)’: func.c:2493:45: error: no matching

Re: Custom calling conventions

2012-02-21 Thread Daniel Murphy
Why can't you do that with existing language features? alias JniExternFunc!(void function(int)) someJNIFuncYouWantToCallFromD; mixin JniExportFunc!(dFuncYouWantToCallUsingJNI); Where the templates generate the wrapper code/calling convention arg shuffle for each function.

Re: Custom calling conventions

2012-02-21 Thread Manu
On 21 February 2012 14:13, Daniel Murphy yebbl...@nospamgmail.com wrote: Why can't you do that with existing language features? alias JniExternFunc!(void function(int)) someJNIFuncYouWantToCallFromD; mixin JniExportFunc!(dFuncYouWantToCallUsingJNI); Where the templates generate the wrapper

Re: Custom calling conventions

2012-02-21 Thread Artur Skawina
On 02/21/12 12:03, Manu wrote: So I was thinking about this extern(language) thing, the obvious ones are supported, but it would be really nice to be able to implement custom conventions for other languages/scripting languages. For instance, I'm thinking about Android, I have JNI binding

Re: Custom calling conventions

2012-02-21 Thread Iain Buclaw
On 21 February 2012 11:03, Manu turkey...@gmail.com wrote: So I was thinking about this extern(language) thing, the obvious ones are supported, but it would be really nice to be able to implement custom conventions for other languages/scripting languages. For instance, I'm thinking about

Re: The Right Approach to Exceptions

2012-02-21 Thread Jacob Carlborg
On 2012-02-20 23:44, Juan Manuel Cabo wrote: I still don't like the idea of using Variant[string], though. (1) It doesn't allow compile-time type checking. This is a big minus, in my book. When you need compile-time type checking, define a variable in your class. Just make sure that you are

Re: Custom calling conventions

2012-02-21 Thread Manu
On 21 February 2012 14:33, Iain Buclaw ibuc...@ubuntu.com wrote: On 21 February 2012 11:03, Manu turkey...@gmail.com wrote: So I was thinking about this extern(language) thing, the obvious ones are supported, but it would be really nice to be able to implement custom conventions for other

Re: size_t + ptrdiff_t

2012-02-21 Thread Vladimir Panteleev
On Sunday, 19 February 2012 at 16:23:50 UTC, Manu wrote: On 19 February 2012 18:03, Vladimir Panteleev vladi...@thecybershadow.netwrote: On Sunday, 19 February 2012 at 15:26:27 UTC, Manu wrote: There is code that assumes size_t is the width of the pointer When is this not true? I can only

Re: The Right Approach to Exceptions

2012-02-21 Thread Robert Jacques
On Mon, 20 Feb 2012 21:08:07 -0600, H. S. Teoh hst...@quickfur.ath.cx wrote: On Mon, Feb 20, 2012 at 08:41:47PM -0600, Andrei Alexandrescu wrote: On 2/20/12 8:33 PM, Robert Jacques wrote: Variant e = new MyException(); writeln( e.filename, e.line, e.column); Aren't __traits and opDispatch

Re: Custom calling conventions

2012-02-21 Thread Gor Gyolchanyan
Yes, I;m also talking about compile-time feature. Dynamic typing certainly doesn't require dynamic calling conventions. On Tue, Feb 21, 2012 at 3:28 PM, Manu turkey...@gmail.com wrote: On 21 February 2012 13:19, Gor Gyolchanyan gor.f.gyolchan...@gmail.com wrote: This is just what I needed. I

Re: The Right Approach to Exceptions

2012-02-21 Thread Andrei Alexandrescu
On 2/21/12 4:48 AM, foobar wrote: On Tuesday, 21 February 2012 at 02:23:58 UTC, Andrei Alexandrescu wrote: On 2/20/12 7:02 PM, Juan Manuel Cabo wrote: oops, sorry!! I just saw a post by someone named Jose. My thousand apollogies!! I got confused. It was your argument I meant to refer to -

Re: The Right Approach to Exceptions

2012-02-21 Thread Andrei Alexandrescu
On 2/21/12 4:34 AM, deadalnix wrote: Le 20/02/2012 21:57, Andrei Alexandrescu a écrit : class DRoxException : Exception { mixin(enableRTTI); ... normal implementation ... } Andrei Why not using std.rtti and generate run time reflection info from compile time reflexion capability ? This

Re: The Right Approach to Exceptions

2012-02-21 Thread Andrei Alexandrescu
On 2/21/12 4:40 AM, Vincent wrote: On Saturday, 18 February 2012 at 18:52:05 UTC, Andrei Alexandrescu wrote: From experience I humbly submit that catching by type is most of the time useless. Completely disagree. Types allow to control place for catch. Say, some deeply nested function catches

Re: Custom calling conventions

2012-02-21 Thread Andrei Alexandrescu
On 2/21/12 5:19 AM, Gor Gyolchanyan wrote: This is just what I needed. I need to create a new calling convention to implement dynamic data typing without resorting to incredibly slow and cumbersome Variant. If Variant is incredibly slow, that's a bug. It's a tagged union so for many types

Re: The Right Approach to Exceptions

2012-02-21 Thread Andrei Alexandrescu
On 2/21/12 5:11 AM, Jacob Carlborg wrote: On 2012-02-21 03:34, Andrei Alexandrescu wrote: I think the correct way of handling this is provide enough information in the exception so a message can be built where the exception is caught. Quite so. I'd add using a unified interface so reusable

Re: The Right Approach to Exceptions

2012-02-21 Thread Andrei Alexandrescu
On 2/21/12 5:55 AM, Regan Heath wrote: On Sun, 19 Feb 2012 23:04:59 -, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 2/19/12 4:00 PM, Nick Sabalausky wrote: Seriously, how is this not *already* crystal-clear? I feel as if every few weeks you're just coming up with

Re: The Right Approach to Exceptions

2012-02-21 Thread Andrei Alexandrescu
On 2/21/12 6:36 AM, Jacob Carlborg wrote: On 2012-02-20 23:44, Juan Manuel Cabo wrote: I still don't like the idea of using Variant[string], though. (1) It doesn't allow compile-time type checking. This is a big minus, in my book. When you need compile-time type checking, define a variable

Re: The Right Approach to Exceptions

2012-02-21 Thread foobar
On Tuesday, 21 February 2012 at 14:13:55 UTC, Andrei Alexandrescu wrote: On 2/21/12 4:48 AM, foobar wrote: On Tuesday, 21 February 2012 at 02:23:58 UTC, Andrei Alexandrescu wrote: On 2/20/12 7:02 PM, Juan Manuel Cabo wrote: oops, sorry!! I just saw a post by someone named Jose. My thousand

Re: Questions about windows support

2012-02-21 Thread Jacob Carlborg
On 2012-02-20 22:36, Benjamin Thaut wrote: 3) Am I mistaken or are most of the people here using dmd under linux? General bugs or linux only bugs tend to get fixed a lot faster then windows only bugs. Mac OS X here. -- /Jacob Carlborg

Re: Towards a better conceptual model of exceptions (Was: Re: The Right Approach to Exceptions)

2012-02-21 Thread Artur Skawina
On 02/21/12 09:15, H. S. Teoh wrote: Sorry for this super-long post, but I wanted to lay my ideas out in a coherent fashion so that we can discuss its conceptual aspects without getting lost with arguing about the details. I hope this is a step in the right direction toward a better model of

Re: The Right Approach to Exceptions

2012-02-21 Thread Andrei Alexandrescu
On 2/21/12 8:38 AM, foobar wrote: On Tuesday, 21 February 2012 at 14:13:55 UTC, Andrei Alexandrescu wrote: On 2/21/12 4:48 AM, foobar wrote: On Tuesday, 21 February 2012 at 02:23:58 UTC, Andrei Alexandrescu wrote: On 2/20/12 7:02 PM, Juan Manuel Cabo wrote: oops, sorry!! I just saw a post by

Re: D autocomplete

2012-02-21 Thread Jacob Carlborg
On 2012-02-21 09:14, Daniel Murphy wrote: Jacob Carlborgd...@me.com wrote in message news:jhvja0$vkq$1...@digitalmars.com... libclang is awesome, so libdmd should be /more/ awesome, right? -- James Miller Yes, even more awesome, and written in D :) -- /Jacob Carlborg Would be much

Re: Custom calling conventions

2012-02-21 Thread Michel Fortin
On 2012-02-21 11:03:09 +, Manu turkey...@gmail.com said: So I was thinking about this extern(language) thing, the obvious ones are supported, but it would be really nice to be able to implement custom conventions for other languages/scripting languages. For instance, I'm thinking about

new std.variant (was Re: The Right Approach to Exceptions)

2012-02-21 Thread Adam D. Ruppe
On Tuesday, 21 February 2012 at 02:33:15 UTC, Robert Jacques wrote: Nope. See (https://jshare.johnshopkins.edu/rjacque2/public_html/ ) Any luck in getting the required patches into phobos? I'd love to see this full thing in there for the next release. It rox.

Re: Custom calling conventions

2012-02-21 Thread Gor Gyolchanyan
There are cases where i don't need type checking per Variant. In case of dynamic function calls, the parameters would be passed to a template, which would generate a TypeInfo of a function, with those parameter types and will compare with TypeInfo of the underlying function, effectively making

Re: The Right Approach to Exceptions

2012-02-21 Thread Juan Manuel Cabo
This works: // note: the int parameter above isn't static dbConn.query(select age from people where id='foobar'); throw new WithErrorCode!FileNotFoundException( db.rs.getValue(1), file not found); ... Can you offer a real world use-case where the above isn't sufficient? What

Re: Custom calling conventions

2012-02-21 Thread Gor Gyolchanyan
Any D type can be stored in size_t.sizeof * 2 bytes of storage and every type can be stored in that storage directly with the exception of static arrays, which are stored as synamic arrays and large structures, which are copied to the heap and stored by pointer. These size_t.sizeof * 2 bytes

Re: Towards a better conceptual model of exceptions (Was: Re: The Right Approach to Exceptions)

2012-02-21 Thread deadalnix
Le 21/02/2012 11:55, deadalnix a écrit : First great post. Don't be sorry, it is insightful. The Condition catgory make a lot of sense to me. Le 21/02/2012 09:15, H. S. Teoh a écrit : Currently, I'm still unsure whether Conditions and Exceptions should be unified, or they should be kept

Re: The Right Approach to Exceptions

2012-02-21 Thread Juan Manuel Cabo
I think he meant to say things have been like that for a while and there's no blood in the streets. That's exactly what I meant. And even if one makes those fields private, anyone can take a pointer to the class or void[] or whatever and do a mess. (Java isn't exepmpt, you can do a mess with

Re: The Right Approach to Exceptions

2012-02-21 Thread Jacob Carlborg
On 2012-02-21 15:16, Andrei Alexandrescu wrote: On 2/21/12 5:11 AM, Jacob Carlborg wrote: On 2012-02-21 03:34, Andrei Alexandrescu wrote: I think the correct way of handling this is provide enough information in the exception so a message can be built where the exception is caught. Quite so.

Re: Questions about windows support

2012-02-21 Thread Nick Sabalausky
Adam D. Ruppe destructiona...@gmail.com wrote in message news:epzlyfzibmpuoilaw...@forum.dlang.org... On Tuesday, 21 February 2012 at 00:38:46 UTC, Andrei Alexandrescu wrote: ssh into Windows and... well last time I did it it was like welcome to Hell. Oh, certainly! Does anyone suppose it

Re: The Right Approach to Exceptions

2012-02-21 Thread Juan Manuel Cabo
Never mind modifying fields of the exception at some intermediate catch place. Someone could even catch the exception and not rethrow it. So: do some trusting. Life gets easier :-) --jm On 02/21/2012 12:46 PM, Juan Manuel Cabo wrote: I think he meant to say things have been like that for a

Re: The Right Approach to Exceptions

2012-02-21 Thread foobar
On Tuesday, 21 February 2012 at 15:38:15 UTC, Juan Manuel Cabo wrote: This works: // note: the int parameter above isn't static dbConn.query(select age from people where id='foobar'); throw new WithErrorCode!FileNotFoundException( db.rs.getValue(1), file not found); ... Can you offer

Re: The Right Approach to Exceptions

2012-02-21 Thread Juan Manuel Cabo
FileNotFoundException is the super class of the others so the first catch clause is enough. in fact, the others will never be called if listed in the above order. Nice! I missed that. But what if you want to add ErrorCode and Rainbows? And with your approach, one has to test for type and

Re: The Right Approach to Exceptions

2012-02-21 Thread Juan Manuel Cabo
Also, you would lose the stacktrace by rethrowing with a different exception object. (Currently, the stacktrace is lost by rethrowing the same object, but the Exception.file and Exception.line are not lost, and it seems that it is very easy to not lose the stacktrace when rethrowing, and it is

Re: The Right Approach to Exceptions

2012-02-21 Thread foobar
On Tuesday, 21 February 2012 at 14:56:52 UTC, Andrei Alexandrescu wrote: Can you offer a real world use-case where the above isn't sufficient? This has been discussed. A function would want to add contextual information to an exception and rethrow it. Requiring a new type for each such

Re: The Right Approach to Exceptions

2012-02-21 Thread Andrei Alexandrescu
On 2/21/12 10:39 AM, foobar wrote: Regarding the downcast - you still perform a check in the code above! You gained nothing by replacing a type check with a check on a hash. You do gain because capability checks don't force a tree structure, whereas downcasting does. Regarding composition

Re: Towards a better conceptual model of exceptions (Was: Re: The Right Approach to Exceptions)

2012-02-21 Thread H. S. Teoh
On Tue, Feb 21, 2012 at 03:54:30PM +0100, Artur Skawina wrote: On 02/21/12 09:15, H. S. Teoh wrote: Sorry for this super-long post, but I wanted to lay my ideas out in a coherent fashion so that we can discuss its conceptual aspects without getting lost with arguing about the details. I

Re: Questions about windows support

2012-02-21 Thread Nick Sabalausky
H. S. Teoh hst...@quickfur.ath.cx wrote in message news:mailman.740.1329784653.20196.digitalmar...@puremagic.com... On Tue, Feb 21, 2012 at 12:21:33AM +0100, Adam D. Ruppe wrote: On Monday, 20 February 2012 at 23:12:36 UTC, James Miller wrote: Windows has not, historically, been a pleasant

Re: The Right Approach to Exceptions

2012-02-21 Thread Juan Manuel Cabo
throw new WithRainbows!withErrorCode!withFoobar!FileNotFoundException(...); So: catch (WithRainbows!withErrorCode!withFoobar!FileNotFoundException ex) { } catch (WithRainbows!withErrorCode!withFoobar!FileNotFoundException ex) { } catch

Re: The Right Approach to Exceptions

2012-02-21 Thread Piotr Szturmaj
Walter Bright wrote: On 2/18/2012 3:13 PM, Andrei Alexandrescu wrote: On 2/18/12 4:26 PM, Jonathan M Davis wrote (abridged): GetOptException FlagArgumentMissingException InvalidFlagArgumentException UnknownFlagException FileException FileNotFoundException NotFileException NotDirException

Re: The Right Approach to Exceptions

2012-02-21 Thread Andrei Alexandrescu
On 2/21/12 10:50 AM, Juan Manuel Cabo wrote: I thought that an alternative to Variant[string] would be to have some virtual functions overrideable (getExceptionData(string dataName) or something). but they would all have to return Object or Variant, so it's the same thing. Exactly. By and

Re: Towards a better conceptual model of exceptions (Was: Re: The Right Approach to Exceptions)

2012-02-21 Thread deadalnix
Le 21/02/2012 17:56, H. S. Teoh a écrit : The only thing I added, perhaps, is that instead of problem-specific conditions, as they appear to have in Lisp, I'm looking at generic categories of conditions, that you can handle from high-level code without ever needing to know the specifics of

Re: Custom calling conventions

2012-02-21 Thread H. S. Teoh
On Tue, Feb 21, 2012 at 01:03:09PM +0200, Manu wrote: So I was thinking about this extern(language) thing, the obvious ones are supported, but it would be really nice to be able to implement custom conventions for other languages/scripting languages. For instance, I'm thinking about Android,

Re: Custom calling conventions

2012-02-21 Thread Manu
On 21 February 2012 16:59, Michel Fortin michel.for...@michelf.com wrote: On 2012-02-21 11:03:09 +, Manu turkey...@gmail.com said: So I was thinking about this extern(language) thing, the obvious ones are supported, but it would be really nice to be able to implement custom conventions

Re: Towards a better conceptual model of exceptions (Was: Re: The Right Approach to Exceptions)

2012-02-21 Thread H. S. Teoh
On Tue, Feb 21, 2012 at 06:01:09PM +0100, deadalnix wrote: Le 21/02/2012 17:56, H. S. Teoh a écrit : The only thing I added, perhaps, is that instead of problem-specific conditions, as they appear to have in Lisp, I'm looking at generic categories of conditions, that you can handle from

Re: Custom calling conventions

2012-02-21 Thread Manu
On 21 February 2012 19:02, H. S. Teoh hst...@quickfur.ath.cx wrote: On Tue, Feb 21, 2012 at 01:03:09PM +0200, Manu wrote: So I was thinking about this extern(language) thing, the obvious ones are supported, but it would be really nice to be able to implement custom conventions for other

Re: Custom calling conventions

2012-02-21 Thread Alex Rønne Petersen
On 21-02-2012 18:03, Manu wrote: On 21 February 2012 16:59, Michel Fortin michel.for...@michelf.com mailto:michel.for...@michelf.com wrote: On 2012-02-21 11:03:09 +, Manu turkey...@gmail.com mailto:turkey...@gmail.com said: So I was thinking about this extern(language)

  1   2   3   4   >