Re: Questions about windows support

2012-02-21 Thread Paulo Pinto
This is just a guess, since I've mostly used GUI access (VNC, Citrix and lately RDP). I would say SSH use in Windows is quite limited, depending on what you want to do, because historically most Windows developers lack the culture to separate application code from UI, which leads to many appl

Re: Custom calling conventions

2012-02-21 Thread Jacob Carlborg
On 2012-02-22 00:13, Manu wrote: On 21 February 2012 23:06, Jacob Carlborg I've answered to this in an answer to Michel's answer. I've had a serious concern about D's lack of a force-inline for quite a while... -- /Jacob Carlborg

Re: Custom calling conventions

2012-02-21 Thread Jacob Carlborg
On 2012-02-22 05:38, Michel Fortin wrote: On 2012-02-21 23:13:31 +, Manu said: On 21 February 2012 23:06, Jacob Carlborg wrote: On 2012-02-21 22:01, Manu wrote: On 21 February 2012 22:35, Jacob Carlborg But to give a quick example: class Foo : NSObject { Foo foo () { return invokeO

Re: The Right Approach to Exceptions

2012-02-21 Thread Jonathan M Davis
On Wednesday, February 22, 2012 08:22:21 Jacob Carlborg wrote: > Now I'm completely lost. According to what I've read this is thread this > is exactly what you want to do, put the formatting inside the exceptions. No. He wants to provide a way for an external function to generically generate stri

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 08:56:03PM +0100, deadalnix wrote: > Le 21/02/2012 20:00, H. S. Teoh a écrit : [...] > >You're right, that would be unnecessary duplication, especially since > >an unhandled Condition becomes a thrown Exception anyway, and it's a > >very bad idea to duplicate the entire Exce

Re: The Right Approach to Exceptions

2012-02-21 Thread Jacob Carlborg
On 2012-02-21 22:08, Andrei Alexandrescu wrote: On 2/21/12 2:42 PM, Jacob Carlborg wrote: On 2012-02-21 21:27, Andrei Alexandrescu wrote: On 2/21/12 2:26 PM, Jacob Carlborg wrote: As I said, it seems you want to push up implementation details specific to a given subclass to the base class even

Re: size_t + ptrdiff_t

2012-02-21 Thread Jacob Carlborg
On 2012-02-22 06:24, Walter Bright wrote: On 2/21/2012 2:11 PM, Stewart Gordon wrote: When did C gain a type called ulong, anyway? unsigned long Are we going to have c_long_long as well? Probably. Wouldn't that always be a "long" in D? Or is it the same as with "long" in C. -- /Jacob

Re: size_t + ptrdiff_t

2012-02-21 Thread Iain Buclaw
On 22 February 2012 02:19, Walter Bright wrote: > On 2/21/2012 1:03 AM, Artur Skawina wrote: >> >> Types like ptrdiff_t are not necessary in D, because you can write >> portable >> code using 'auto' and 'typeof()' - std C didn't have these, so a type had >> to be invented for everything. > > > And

Re: Questions about windows support

2012-02-21 Thread H. S. Teoh
On Wed, Feb 22, 2012 at 03:44:33AM +0100, Adam D. Ruppe wrote: > On Wednesday, 22 February 2012 at 02:03:58 UTC, H. S. Teoh wrote: > >Hmm. Let's implement shell utilities in D! (Pointless, yeah, but a > >fun exercise to see how much cleaner D code can be -- if you've > > I'm sooo tempted again. >

Re: Why is there no or or and ?

2012-02-21 Thread Daren Scot Wilson
On Friday, 17 February 2012 at 16:43:54 UTC, F i L wrote: I just don't see an argument for why we *shouldn't* make mathematical operations in code match those we where taught as children as close as possible. There is a profound difference in that math is mostly about making a series of

Re: size_t + ptrdiff_t

2012-02-21 Thread Walter Bright
On 2/21/2012 9:56 PM, Jonathan M Davis wrote: On Tuesday, February 21, 2012 21:22:54 Walter Bright wrote: On 2/21/2012 4:50 PM, Juan Manuel Cabo wrote: Looking for size_t extravagancies in C, I found that VC uses __int64 for size_t in x64 target. Which is correct. size_t for 64 bit D is also

Re: size_t + ptrdiff_t

2012-02-21 Thread Jonathan M Davis
On Tuesday, February 21, 2012 21:22:54 Walter Bright wrote: > On 2/21/2012 4:50 PM, Juan Manuel Cabo wrote: > > Looking for size_t extravagancies in C, I found that VC uses __int64 > > for size_t in x64 target. > > Which is correct. > > size_t for 64 bit D is also a 64 bit integral type. Yes, bu

Re: The Right Approach to Exceptions

2012-02-21 Thread H. S. Teoh
On Tue, Feb 21, 2012 at 07:43:32PM -0500, Jonathan M Davis wrote: > On Tuesday, February 21, 2012 14:15:03 Andrei Alexandrescu wrote: > > I thought I was pushing the generics angle, and OO people explained > > it to me that that was wrong. I've changed my mind. Now I'm trying to see if the generic

Re: size_t + ptrdiff_t

2012-02-21 Thread Walter Bright
On 2/21/2012 2:11 PM, Stewart Gordon wrote: When did C gain a type called ulong, anyway? unsigned long Are we going to have c_long_long as well? Probably.

Re: size_t + ptrdiff_t

2012-02-21 Thread Walter Bright
On 2/21/2012 4:50 PM, Juan Manuel Cabo wrote: Looking for size_t extravagancies in C, I found that VC uses __int64 for size_t in x64 target. Which is correct. size_t for 64 bit D is also a 64 bit integral type.

Re: size_t + ptrdiff_t

2012-02-21 Thread Walter Bright
On 2/21/2012 6:07 PM, Juan Manuel Cabo wrote: 16bit intel had 16bit segments and offsets, so memory was segmented and you couldn't address more than 64kb at a time. So you couldn't have grabbed^H^H"allocated" more than 64kb in real mode in intel in a single linear block. size_t was 16 bits on a

Re: Questions about windows support

2012-02-21 Thread James Miller
On 22 February 2012 13:06, H. S. Teoh wrote: > On Wed, Feb 22, 2012 at 12:39:01AM +0100, Adam D. Ruppe wrote: > [...] >> Yeah, though I've only seen it suggested for daemon like >> programs... I think you're the first person who I've seen >> suggest it for gui apps too. >> >> Not a bad idea. > > P

Re: Custom calling conventions

2012-02-21 Thread Michel Fortin
On 2012-02-21 23:13:31 +, Manu said: On 21 February 2012 23:06, Jacob Carlborg wrote: On 2012-02-21 22:01, Manu wrote: On 21 February 2012 22:35, Jacob Carlborg But to give a quick example: class Foo : NSObject { Foo foo () { return invokeObjcSelf!(Foo, "foo"); } Foo bar () { retur

Re: Questions about windows support

2012-02-21 Thread Nick Sabalausky
"H. S. Teoh" wrote in message news:mailman.842.1329878177.20196.digitalmar...@puremagic.com... > On Tue, Feb 21, 2012 at 08:09:49PM -0500, Nick Sabalausky wrote: >> "H. S. Teoh" wrote in message >> news:mailman.830.1329870386.20196.digitalmar...@puremagic.com... >> > On Tue, Feb 21, 2012 at 06:0

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

2012-02-21 Thread Andrei Alexandrescu
On 2/21/12 6:11 PM, Robert Jacques wrote: On Tue, 21 Feb 2012 09:12:57 -0600, Adam D. Ruppe wrote: 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

Re: Questions about windows support

2012-02-21 Thread Adam D. Ruppe
On Wednesday, 22 February 2012 at 02:03:58 UTC, H. S. Teoh wrote: Hmm. Let's implement shell utilities in D! (Pointless, yeah, but a fun exercise to see how much cleaner D code can be -- if you've I'm sooo tempted again. Though, I don't really like shell utilities I'd want many of them to

Re: Questions about windows support

2012-02-21 Thread H. S. Teoh
On Tue, Feb 21, 2012 at 08:09:49PM -0500, Nick Sabalausky wrote: > "H. S. Teoh" wrote in message > news:mailman.830.1329870386.20196.digitalmar...@puremagic.com... > > On Tue, Feb 21, 2012 at 06:01:37PM -0500, Nick Sabalausky wrote: [...] > >> Heh, as bad as this might sound, I think what I basic

Re: [RFC] Ini parser

2012-02-21 Thread bioinfornatics
I have wrote a ini parser it can use bidirectional range example of ini file able to parse: ___ [sectionA] param1=value1 param2=value2 [[subSectionA]] param1sub=value1sub [sectionB] param3=value3 ; I am a comment param4=value4 [se

Re: size_t + ptrdiff_t

2012-02-21 Thread Walter Bright
On 2/21/2012 12:33 AM, Manu wrote: On 21 February 2012 01:22, Walter Bright mailto: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 stil

Re: size_t + ptrdiff_t

2012-02-21 Thread Walter Bright
On 2/21/2012 1:03 AM, Artur Skawina wrote: Types like ptrdiff_t are not necessary in D, because you can write portable code using 'auto' and 'typeof()' - std C didn't have these, so a type had to be invented for everything. And, in fact, object.di contains: alias typeof(int.sizeof)

Re: size_t + ptrdiff_t

2012-02-21 Thread Juan Manuel Cabo
>> I'm surprised. I'd assumed that, under 16-bit DOS/Windows, a size_t would >> be 16 bits. But no. Could memory blocks 64K or larger actually be >> allocated under those systems? size_t being the typeof sizeof() expressions, tell you the upper bound for the size of static arrays, statically a

Re: Questions about windows support

2012-02-21 Thread H. S. Teoh
On Wed, Feb 22, 2012 at 01:33:56AM +0100, Adam D. Ruppe wrote: > Thinking about globbing, I think rm * is a mistake > anyway... > > The way I'd do programs is something like this: > > echo input > program_name options > > So, you wouldn't rm *. You'd ls | rm. > > You'd implement rm like thi

Re: size_t + ptrdiff_t

2012-02-21 Thread Juan Manuel Cabo
I just went to see a standard draft (http://www.clc-wiki.net/wiki/the_C_Standard) to make sure, and it is even more convoluted than just that, but essentially the same. Basically it says that chars must be at least 8bits and that shorts and ints must be able to represent at least 16 bits. Then th

Re: Questions about windows support

2012-02-21 Thread H. S. Teoh
On Tue, Feb 21, 2012 at 07:45:36PM -0500, Nick Sabalausky wrote: [...] > Windows's cmd.exe always inserts a newline right before a command > prompt. So you get the best of both worlds. Only issue is you end up > with excess newlines. For example, you get: > > C:\>echo Hello > filea.txt > > C:\>ec

Re: size_t + ptrdiff_t

2012-02-21 Thread Juan Manuel Cabo
On 02/21/2012 10:13 PM, Sean Kelly wrote: > I think this is actually a good thing, since working with unsigned integers > is a pain. Yes, I would prefer that msb bit to be the sign too, but behavior might depend on it, and correctness and predictability is important. My first code snippet was W

Re: Questions about windows support

2012-02-21 Thread H. S. Teoh
On Tue, Feb 21, 2012 at 07:27:41PM -0500, Nick Sabalausky wrote: > "H. S. Teoh" wrote in message > news:mailman.826.1329869015.20196.digitalmar...@puremagic.com... [...] > > fg/bg is the best thing on earth since sliced bread. Well, to me. :) > > > > It lets me fire up my (text-based) mail client

Re: size_t + ptrdiff_t

2012-02-21 Thread Stewart Gordon
On 21/02/2012 22:45, Juan Manuel Cabo wrote: The C standard only guarantees that: sizeof(char)<= sizeof(int)<= sizeof(long)<= sizeof(size_t) I'm surprised. I'd assumed that, under 16-bit DOS/Windows, a size_t would be 16 bits. But no. Could memory blocks 64K or larger actually be alloc

Re: Questions about windows support

2012-02-21 Thread Nick Sabalausky
"H. S. Teoh" wrote in message news:mailman.830.1329870386.20196.digitalmar...@puremagic.com... > On Tue, Feb 21, 2012 at 06:01:37PM -0500, Nick Sabalausky wrote: > [...] >> Hmm, if that's like Total Commander on Windows, then I don't think I >> would like it. I do *love* Total Commander's multi-f

Re: size_t + ptrdiff_t

2012-02-21 Thread Sean Kelly
On Feb 21, 2012, at 4:50 PM, Juan Manuel Cabo wrote: >> size_t is intended to be the C representation. I very much do not want to >> end up with a c_size_t. > > Hahah, hold your jaw because it might drop: > > Looking for size_t extravagancies in C, I found that VC uses __int64 > for size_t in

Re: size_t + ptrdiff_t

2012-02-21 Thread Juan Manuel Cabo
I'm sorry, my snippet is wrong. It's a bit more complicated than what I first thought, and not even uniform between VC versions: "size_t definition and C4267 warning" social.msdn.microsoft.com/forums/en-US/vclanguage/thread/62d6df45-e8e4-4bb2-87e2-b3f8e85b4b37 --jm On 02/21/2012 09:50 PM

Re: Questions about windows support

2012-02-21 Thread H. S. Teoh
On Wed, Feb 22, 2012 at 01:21:41AM +0100, Adam D. Ruppe wrote: > On Wednesday, 22 February 2012 at 00:03:35 UTC, H. S. Teoh wrote: > >It lets me fire up my (text-based) mail client > > mutt Yep! > I switched to mutt from the terrible webmail in... 2007 I think. > Rarely look back (only when

Re: size_t + ptrdiff_t

2012-02-21 Thread Juan Manuel Cabo
> size_t is intended to be the C representation. I very much do not want to > end up with a c_size_t. Hahah, hold your jaw because it might drop: Looking for size_t extravagancies in C, I found that VC uses __int64 for size_t in x64 target. So this behaves differently according to the target:

Re: Questions about windows support

2012-02-21 Thread Nick Sabalausky
"H. S. Teoh" wrote in message news:mailman.829.1329869699.20196.digitalmar...@puremagic.com... > On Tue, Feb 21, 2012 at 06:49:45PM -0500, Nick Sabalausky wrote: > [...] >> I think that globbing should be done explicity by the app, *but* for >> apps that don't play ball you should be able to *exp

Re: The Right Approach to Exceptions

2012-02-21 Thread Jonathan M Davis
On Tuesday, February 21, 2012 14:15:03 Andrei Alexandrescu wrote: > I thought I was pushing the generics angle, and OO people explained it > to me that that was wrong. You were just talking about applying OO policy to exceptions, which just doesn't make sense for most things, because they're jus

Re: Questions about windows support

2012-02-21 Thread Adam D. Ruppe
Thinking about globbing, I think rm * is a mistake anyway... The way I'd do programs is something like this: echo input > program_name options So, you wouldn't rm *. You'd ls | rm. You'd implement rm like this: void main() { foreach(file; stdin.byLine) std.file.remove(file);

Re: Questions about windows support

2012-02-21 Thread Nick Sabalausky
"H. S. Teoh" wrote in message news:mailman.826.1329869015.20196.digitalmar...@puremagic.com... > On Tue, Feb 21, 2012 at 06:22:25PM -0500, Nick Sabalausky wrote: > [...] >> That hadn't occurred to me. Thanks. Normally, the only time I use >> fg/bg is if I try to cancel something with Ctrl-blah an

Re: Questions about windows support

2012-02-21 Thread H. S. Teoh
On Tue, Feb 21, 2012 at 06:01:37PM -0500, Nick Sabalausky wrote: [...] > Hmm, if that's like Total Commander on Windows, then I don't think I > would like it. I do *love* Total Commander's multi-file renaming, but > that feature is really the only reason I keep it around. > > Heh, as bad as this m

Re: Questions about windows support

2012-02-21 Thread Adam D. Ruppe
On Wednesday, 22 February 2012 at 00:03:35 UTC, H. S. Teoh wrote: It lets me fire up my (text-based) mail client mutt I switched to mutt from the terrible webmail in... 2007 I think. Rarely look back (only when I need to view images when on a separate computer). I handle 200-300 emails a

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

2012-02-21 Thread Robert Jacques
On Tue, 21 Feb 2012 09:12:57 -0600, Adam D. Ruppe wrote: 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 fo

Re: Questions about windows support

2012-02-21 Thread H. S. Teoh
On Tue, Feb 21, 2012 at 06:49:45PM -0500, Nick Sabalausky wrote: [...] > I think that globbing should be done explicity by the app, *but* for > apps that don't play ball you should be able to *explicitly* do it at > the command line. Example: > > $someutil *.txt foo.html > ERROR: Can't find file '

Re: size_t + ptrdiff_t

2012-02-21 Thread Sean Kelly
On Feb 21, 2012, at 3:50 PM, Juan Manuel Cabo wrote: >> Eh? > > All the type sizes vary in broken ways in C. The only sane way > to port C structs to D is to use c_ that has the size of the > C compiler in the target platform. > > If there is a single C compiler has a different sized size_t > th

Re: Questions about windows support

2012-02-21 Thread Nick Sabalausky
"H. S. Teoh" wrote in message news:mailman.824.1329867308.20196.digitalmar...@puremagic.com... > > You can do: > > program_name >/dev/null 2>&1 & > > That will silence everything. But yeah, too much typing, too much > obscure stdout/stderr redirecting for a newbie to even begin to dream > that su

Re: Questions about windows support

2012-02-21 Thread H. S. Teoh
On Wed, Feb 22, 2012 at 12:39:01AM +0100, Adam D. Ruppe wrote: [...] > Yeah, though I've only seen it suggested for daemon like > programs... I think you're the first person who I've seen > suggest it for gui apps too. > > Not a bad idea. Perhaps I'm just dreaming, but I *think* I've seen one GUI

Re: Questions about windows support

2012-02-21 Thread H. S. Teoh
On Tue, Feb 21, 2012 at 06:22:25PM -0500, Nick Sabalausky wrote: [...] > That hadn't occurred to me. Thanks. Normally, the only time I use > fg/bg is if I try to cancel something with Ctrl-blah and it suspends > the process instead of stopping it. So then I "fg [whatever num]" and > either try a di

Re: size_t + ptrdiff_t

2012-02-21 Thread Juan Manuel Cabo
> Eh? All the type sizes vary in broken ways in C. The only sane way to port C structs to D is to use c_ that has the size of the C compiler in the target platform. If there is a single C compiler has a different sized size_t than D's, then one has achieved nothing with the c_int, c_long, etc. S

Re: Questions about windows support

2012-02-21 Thread Nick Sabalausky
"Bernard Helyer" wrote in message news:iianhomhapvkfhide...@forum.dlang.org... > >Nick replied to something about globbing > Having programs doing the globbing sounds great until you run into someone > who doesn't play ball. *cough* every single digital mars utility *cough*. > I think Windows a

Re: Questions about windows support

2012-02-21 Thread Adam D. Ruppe
On Tuesday, 21 February 2012 at 23:35:09 UTC, H. S. Teoh wrote: That will silence everything. But yeah, too much typing Yea. I'm pretty sure this is common knowledge, just that nobody bothers to do it. But I can dream. :) Yeah, though I've only seen it suggested for daemon like programs...

Re: size_t + ptrdiff_t

2012-02-21 Thread Iain Buclaw
On 21 February 2012 22:45, Juan Manuel Cabo wrote: > > A REQUEST: how about adding a c_size_t too? > Eh? -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0';

Re: Questions about windows support

2012-02-21 Thread H. S. Teoh
On Tue, Feb 21, 2012 at 11:35:09PM +0100, Adam D. Ruppe wrote: > On Tuesday, 21 February 2012 at 22:26:34 UTC, Nick Sabalausky wrote: > >On other thing I meant to mention: It's kinda annoying on Linux > >how if you launch a gui app at the command line, it will > >automatically be a blocking foregro

Re: Questions about windows support

2012-02-21 Thread Nick Sabalausky
"Adam D. Ruppe" wrote in message news:bexfgnarfyprlvslm...@forum.dlang.org... > On Tuesday, 21 February 2012 at 22:26:34 UTC, Nick Sabalausky wrote: >> On other thing I meant to mention: It's kinda annoying on Linux how if >> you launch a gui app at the command line, it will >> automatically be

Re: Custom calling conventions

2012-02-21 Thread Manu
On 21 February 2012 23:06, Jacob Carlborg wrote: > On 2012-02-21 22:01, Manu wrote: > >> On 21 February 2012 22:35, Jacob Carlborg > >> > wrote: >> >>On 2012-02-21 20:45, Manu wrote: >> >>On 21 February 2012 20:12, Jacob Carlborg > >>

Re: Questions about windows support

2012-02-21 Thread Nick Sabalausky
"H. S. Teoh" wrote in message news:mailman.812.1329855805.20196.digitalmar...@puremagic.com... > On Tue, Feb 21, 2012 at 11:50:24AM -0500, Nick Sabalausky wrote: > [...] >> I literally grew up on command-lines[1]. But despite that, I still >> much prefer GUIs for anything a GUI reasonably works f

Re: The Right Approach to Exceptions

2012-02-21 Thread Martin Nowak
On Tue, 21 Feb 2012 23:29:32 +0100, H. S. Teoh wrote: On Tue, Feb 21, 2012 at 03:15:19PM -0600, Andrei Alexandrescu wrote: [...] A more debatable aspect of exceptions is the first-match rule in catch blocks. All of OOP goes with best match, except here. But then all code is together so the e

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 07:15:29PM +0100, Artur Skawina wrote: > On 02/21/12 17:56, H. S. Teoh wrote: [...] > I don't think something like this can reliably work - handling unknown > error conditions in code not expecting them is not a good idea. I'm not proposing we do this for *every* error. Onl

Re: size_t + ptrdiff_t

2012-02-21 Thread Juan Manuel Cabo
> c_long and c_ulong are guaranteed to match target long size (here > would also go c_int and c_uint ;-). > https://bitbucket.org/goshawk/gdc/src/87241c8e754b/d/druntime/core/stdc/config.d#cl-22 That is so good! Thanks! Currently, htod translates "unsigned long" to uint, which is wrong in linux 6

Re: The Right Approach to Exceptions

2012-02-21 Thread deadalnix
Le 21/02/2012 22:15, Andrei Alexandrescu a écrit : What if instead of catching by class, we catch by attribute matching? So instead of writing: try { ... } catch(SomeExceptionType e) { ... } catch(SomeOtherExceptionType e) { ... } catch(YetAnotherSillyException e) { ... } we write: try { ... }

Re: Questions about windows support

2012-02-21 Thread Bernard Helyer
Nick replied to something about globbing Having programs doing the globbing sounds great until you run into someone who doesn't play ball. *cough* every single digital mars utility *cough*. I think Windows and unix both get it wrong, but unix gets it less wrong (as it could theoretically be an

Re: Questions about windows support

2012-02-21 Thread Adam D. Ruppe
On Tuesday, 21 February 2012 at 22:26:34 UTC, Nick Sabalausky wrote: On other thing I meant to mention: It's kinda annoying on Linux how if you launch a gui app at the command line, it will automatically be a blocking foreground process unless you remember to add "&" at the end. Which I always f

Re: The Right Approach to Exceptions

2012-02-21 Thread Ali Çehreli
On 02/18/2012 09:09 PM, Jim Hewes wrote: > I think of exception handling as tied to contract programming. I think your use of the word 'contract' is colliding with the contract programming feature. What you describe later does not match with the contract programming and I guess is the reason w

Re: Questions about windows support

2012-02-21 Thread Nick Sabalausky
"Nick Sabalausky" wrote in message news:ji0s7e$81a$1...@digitalmars.com... > "Adam D. Ruppe" wrote in message > news:veaiisjzbijgdjbzw...@forum.dlang.org... >> On Tuesday, 21 February 2012 at 03:53:20 UTC, H. S. Teoh wrote: >> >>> Heh, never seen that before. I usually just turn off all fancy s

Re: The Right Approach to Exceptions

2012-02-21 Thread H. S. Teoh
On Tue, Feb 21, 2012 at 03:15:19PM -0600, Andrei Alexandrescu wrote: [...] > A more debatable aspect of exceptions is the first-match rule in > catch blocks. All of OOP goes with best match, except here. But then > all code is together so the effect is small. Does it make sense to make it best-mat

Re: size_t + ptrdiff_t

2012-02-21 Thread Stewart Gordon
On 20/02/2012 19:11, Johannes Pfau wrote: Exactly what's written there, c_long and c_ulong always match the C long/ulong types, whatever size those may be. It's mostly (only?) useful for C bindings. So in other words, it just means whatever somebody has decreed that the "long" keyword in C sh

Re: Questions about windows support

2012-02-21 Thread Nick Sabalausky
"H. S. Teoh" wrote in message news:mailman.811.1329854653.20196.digitalmar...@puremagic.com... > On Tue, Feb 21, 2012 at 01:48:35PM -0500, Nick Sabalausky wrote: > [...] >> Another issue with it is that to make a binary work on both an older >> and newer Linux, you have to actually compile it *on

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 02:40:30PM -0500, Jonathan M Davis wrote: > On Tuesday, February 21, 2012 00:15:48 H. S. Teoh wrote: > > TRANSITIVITY > > I still contend that this useless, because you need to know what went wrong > to > know whether you actually want to retry anything. And just because

Re: The Right Approach to Exceptions

2012-02-21 Thread Andrei Alexandrescu
On 2/21/12 2:47 PM, H. S. Teoh wrote: On Tue, Feb 21, 2012 at 09:32:35PM +0100, deadalnix wrote: [...] So it doesn't help. Dulb subclasses of Exceptions are done mostly to be able to catch them. To avoid useless subclasses, we need a more precise way to catch Exception than the type only. [...]

Re: Questions about windows support

2012-02-21 Thread torhu
On 21.02.2012 18:54, Benjamin Thaut wrote: Am 21.02.2012 04:08, schrieb torhu: On 20.02.2012 22:36, Benjamin Thaut wrote: 2) Will dmd support exporting/importing data symbols from dlls? I know there is a patch that does the data symbol address patching from the runtime but thats a feature t

Re: The Right Approach to Exceptions

2012-02-21 Thread Andrei Alexandrescu
On 2/21/12 2:42 PM, Jacob Carlborg wrote: On 2012-02-21 21:27, Andrei Alexandrescu wrote: On 2/21/12 2:26 PM, Jacob Carlborg wrote: As I said, it seems you want to push up implementation details specific to a given subclass to the base class even though it shouldn't be pushed up. I explained

Re: Custom calling conventions

2012-02-21 Thread Jacob Carlborg
On 2012-02-21 22:01, Manu wrote: On 21 February 2012 22:35, Jacob Carlborg mailto:d...@me.com>> wrote: On 2012-02-21 20:45, Manu wrote: On 21 February 2012 20:12, Jacob Carlborg mailto:d...@me.com> >> wrote: On 2012-02-21

Re: Howto build a repo case for a ICE?

2012-02-21 Thread Vladimir Panteleev
On Sunday, 19 February 2012 at 21:42:17 UTC, Vladimir Panteleev wrote: On Sunday, 19 February 2012 at 17:56:42 UTC, Benjamin Thaut wrote: rmdirRecurse which gets called in dustmite.d line 457 throws a exception that causes the D exception handler to go into inifnite recursion which leads to a s

Has anyone tried DMD on Mac OS X Mountain Lion

2012-02-21 Thread Jacob Carlborg
The developer preview of Mac OS X Mountain Lion has recently become available for developers. Has anyone tried DMD on it yet to see if it works? -- /Jacob Carlborg

Re: Custom calling conventions

2012-02-21 Thread Manu
On 21 February 2012 22:35, Jacob Carlborg wrote: > On 2012-02-21 20:45, Manu wrote: > >> On 21 February 2012 20:12, Jacob Carlborg > > wrote: >> >>On 2012-02-21 18:03, Manu wrote: >> >>On 21 February 2012 16:59, Michel Fortin >>>

Re: Custom calling conventions

2012-02-21 Thread Manu
On 21 February 2012 22:33, H. S. Teoh wrote: > On Tue, Feb 21, 2012 at 08:01:11PM +, Iain Buclaw wrote: > > On 21 February 2012 17:10, Manu wrote: > [...] > > > With the (typically VM based) languages I was referring to, there's > > > no direct linkage, all communication must be via some API

Re: The Right Approach to Exceptions

2012-02-21 Thread deadalnix
Le 21/02/2012 01:38, Andrei Alexandrescu a écrit : On 2/20/12 6:25 PM, H. S. Teoh wrote: On Mon, Feb 20, 2012 at 05:15:17PM -0600, Andrei Alexandrescu wrote: Formatting should use class reflection. We already discussed that, and we already agreed that was the superior approach. Jose's argument

Re: The Right Approach to Exceptions

2012-02-21 Thread H. S. Teoh
On Tue, Feb 21, 2012 at 09:32:35PM +0100, deadalnix wrote: [...] > So it doesn't help. Dulb subclasses of Exceptions are done mostly to > be able to catch them. To avoid useless subclasses, we need a more > precise way to catch Exception than the type only. [...] This is a good point. Has anybody

Re: The Right Approach to Exceptions

2012-02-21 Thread Jacob Carlborg
On 2012-02-21 21:27, Andrei Alexandrescu wrote: On 2/21/12 2:26 PM, Jacob Carlborg wrote: As I said, it seems you want to push up implementation details specific to a given subclass to the base class even though it shouldn't be pushed up. I explained that doing so allows for proper formatting

Re: Custom calling conventions

2012-02-21 Thread Jacob Carlborg
On 2012-02-21 20:45, Manu wrote: On 21 February 2012 20:12, Jacob Carlborg mailto:d...@me.com>> wrote: On 2012-02-21 18:03, Manu wrote: On 21 February 2012 16:59, Michel Fortin mailto:michel.for...@michelf.com> I have some experience bridging Objective-C and D. I

Re: Custom calling conventions

2012-02-21 Thread H. S. Teoh
On Tue, Feb 21, 2012 at 08:01:11PM +, Iain Buclaw wrote: > On 21 February 2012 17:10, Manu wrote: [...] > > With the (typically VM based) languages I was referring to, there's > > no direct linkage, all communication must be via some API, so the > > intrinsic knowledge of foreign structures is

Re: The Right Approach to Exceptions

2012-02-21 Thread deadalnix
Le 21/02/2012 00:23, Andrei Alexandrescu a écrit : On 2/20/12 4:44 PM, Juan Manuel Cabo wrote: HAhaha, it sometimes feel as though people are afraid that the Variant[string] idea is to never use plain old variables and never use exception subclasses. :-) On the contrary, the idea is so that pla

Re: The Right Approach to Exceptions

2012-02-21 Thread Andrei Alexandrescu
On 2/21/12 2:26 PM, Jacob Carlborg wrote: As I said, it seems you want to push up implementation details specific to a given subclass to the base class even though it shouldn't be pushed up. I explained that doing so allows for proper formatting of error messages. So it should pushed up. And

Re: The Right Approach to Exceptions

2012-02-21 Thread Jacob Carlborg
On 2012-02-21 21:06, Andrei Alexandrescu wrote: On 2/21/12 12:03 PM, Jacob Carlborg wrote: On 2012-02-21 17:57, Andrei Alexandrescu wrote: 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 (getExce

Re: Custom calling conventions

2012-02-21 Thread Manu
On 21 February 2012 22:01, Iain Buclaw wrote: > On 21 February 2012 17:10, Manu wrote: > > On 21 February 2012 19:02, H. S. Teoh 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 > >> >

Re: Questions about windows support

2012-02-21 Thread H. S. Teoh
On Tue, Feb 21, 2012 at 11:50:24AM -0500, Nick Sabalausky wrote: [...] > I literally grew up on command-lines[1]. But despite that, I still > much prefer GUIs for anything a GUI reasonably works for: Like file > browsers, DB admin, manual DB queries, debuggers, Tortoise*, etc. > (although for web s

Re: The Right Approach to Exceptions

2012-02-21 Thread Andrei Alexandrescu
On 2/21/12 1:17 PM, Jonathan M Davis wrote: On Tuesday, February 21, 2012 10:57:20 Andrei Alexandrescu wrote: 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

Re: The Right Approach to Exceptions

2012-02-21 Thread Andrei Alexandrescu
On 2/21/12 12:03 PM, Jacob Carlborg wrote: On 2012-02-21 17:57, Andrei Alexandrescu wrote: 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 the

Re: The Right Approach to Exceptions

2012-02-21 Thread Jacob Carlborg
On 2012-02-21 19:33, Juan Manuel Cabo wrote: That because you can't (shouldn't) push up implementations specific to a given subclass. Why don't we only have one class, Object, and add a Variant[string] there. Do you see how stupid that is. As stupid as any database API which returns result it

Re: Questions about windows support

2012-02-21 Thread H. S. Teoh
On Tue, Feb 21, 2012 at 01:48:35PM -0500, Nick Sabalausky wrote: [...] > Another issue with it is that to make a binary work on both an older > and newer Linux, you have to actually compile it *on* an older Linux. > I've heard that, in theory, you can use a newer Linux to create > binaries that wor

Re: Custom calling conventions

2012-02-21 Thread Iain Buclaw
On 21 February 2012 17:10, Manu wrote: > On 21 February 2012 19:02, H. S. Teoh 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

Re: Custom calling conventions

2012-02-21 Thread Alex Rønne Petersen
On 21-02-2012 20:43, Manu wrote: On 21 February 2012 19:10, Alex Rønne Petersen mailto:xtzgzo...@gmail.com>> wrote: On 21-02-2012 18:03, Manu wrote: On 21 February 2012 16:59, Michel Fortin mailto:michel.for...@michelf.com>

Re: Custom calling conventions

2012-02-21 Thread Manu
On 21 February 2012 21:03, Paulo Pinto wrote: > I think this fails in the same trap as extern "language" in C++. > > Besides C and C++, I think the only variation I saw so far for the > language part has been fortran, and cannot recall anylonger in what > compiler it was. > > In C++'s case, since

Re: Questions about windows support

2012-02-21 Thread Nick Sabalausky
"Nick Sabalausky" wrote in message news:ji0s7e$81a$1...@digitalmars.com... > > It's pretty though! Crap, now I want to color-code the user and host parts > of my prompts...Especially for root and live production servers, that > could be downright useful: Big bright right "This is ROOT!!!", or "

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

2012-02-21 Thread Jacob Carlborg
On 2012-02-21 09:15, H. S. Teoh wrote: 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

Re: Custom calling conventions

2012-02-21 Thread Michel Fortin
On 2012-02-21 19:45:37 +, Manu said: On 21 February 2012 20:12, Jacob Carlborg wrote: On 2012-02-21 18:03, Manu wrote: On 21 February 2012 16:59, Michel Fortin Template bloat. Every call bridging D/Objective-C is made throw a series of templates. This is for making it possible (less

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

2012-02-21 Thread deadalnix
Le 21/02/2012 20:00, H. S. Teoh a écrit : On Tue, Feb 21, 2012 at 06:24:01PM +0100, deadalnix wrote: Le 21/02/2012 18:10, H. S. Teoh a écrit : [...] True, and there's nothing to stop you from digging into the details of the raised Condition if you want to. I did consider implementing Condition

Re: The Right Approach to Exceptions

2012-02-21 Thread Jonathan M Davis
On Tuesday, February 21, 2012 08:15:29 Andrei Alexandrescu wrote: > 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 disag

Re: Custom calling conventions

2012-02-21 Thread Manu
On 21 February 2012 20:12, Jacob Carlborg wrote: > On 2012-02-21 18:03, Manu wrote: > >> On 21 February 2012 16:59, Michel Fortin >I have some experience bridging Objective-C and D. I once built a >>complete wrapper system for Objective-C objects, each object was >>wrapped by a D one.

  1   2   3   >