Re: A tutorial on D templates: updates

2012-01-30 Thread Mattbeui
On Sunday, 29 January 2012 at 20:44:00 UTC, Philippe Sigaud wrote: Hello, I posted there a few weeks ago about a tutorial on D templates I put in github: https://github.com/PhilippeSigaud/D-templates-tutorial/blob/master/dtemplates.pdf . . . As before, do not hesitate to read, comment, post

Re: A tutorial on D templates: updates

2012-01-30 Thread bls
On 01/29/2012 12:44 PM, Philippe Sigaud wrote: Hello, I posted there a few weeks ago about a tutorial on D templates I put in github: https://github.com/PhilippeSigaud/D-templates-tutorial/blob/master/dtemplates.pdf Since then, I received numerous mails, issues, advices and thanks. Thank to

Re: A tutorial on D templates: updates

2012-01-30 Thread Philippe Sigaud
On Mon, Jan 30, 2012 at 13:07, bls bizp...@orange.fr wrote: First of all thank you so much for this wonderful book! Thanks! I would like to ask for a little enhancement regarding mixin templates. see snippet. Yes, this section is still bit short. But, what enhancement are you talking about?

Re: Mozilla Rust 0.1

2012-01-30 Thread Kagamin
On Saturday, 28 January 2012 at 17:24:03 UTC, Manfred Nowak wrote: Ask your manager why you must type your code in a crouded office space instead of narrating it behind a nice acoustically sealed devider. Never understood these skype addicts. It's freaking generation Y! They're supposed to

Re: A tutorial on D templates: updates

2012-01-30 Thread bls
Hi Philippe, Ok, something more interesting it combines suggestion 2) and 3). Still a quick hack, not much tested, but I think the intention is clear. The snippets show how a publisher subscriber pattern can be mixed in. Further it shows how a simple class could become a stack, queue, list

Re: Server-Side magazine interview, touches on D

2012-01-30 Thread Jesse Phillips
On Sunday, 29 January 2012 at 23:25:36 UTC, Nick Sabalausky wrote: The whole industry's moved over keeping server-side code out of the HTML So the whole industry has moved away from php? Sure templating is used so mixing php and html is as common, but if I'm not mistaken ? is still ? used a

Why not allow people to submit name:url associations for dman?

2012-01-30 Thread Bernard Helyer
I've found myself using dman more than I thought I would, but it is a little annoying when it fails to find a page and I navigate to it manually -- I wouldn't mind if I could improve dman for the next release. Perhaps a text file on GitHub we could submit pull requests to? Thanks, -Bernard.

Re: CTFE attribute

2012-01-30 Thread Don Clugston
On 28/01/12 19:39, Walter Bright wrote: On 1/28/2012 6:50 AM, Manu wrote: I'd certainly like to be able to mark these functions CTFE to be sure no runtime code will ever be generated for them, and also, what can I do about CTFE imports? I don't want that import in my binary... Being in your

Re: dmd2

2012-01-30 Thread Don Clugston
On 29/01/12 23:41, Jonathan M Davis wrote: On Sunday, January 29, 2012 17:48:04 Stewart Gordon wrote: On 29/01/2012 16:24, Chad J wrote: Hey guys, I know this is a bit late given the deprecation of D1 and all, but why did we name the D2 compiler dmd instead of dmd2? I'm not sure. Was D2

Re: indent style for D

2012-01-30 Thread Denis Shelomovskij
30.01.2012 0:49, Walter Bright пишет: On 1/29/2012 6:04 AM, Denis Shelomovskij wrote: Why does Phobos use 4-space indentation? Because it works, changing it would be a vast waste of time for a non-existent benefit, and it would become a nuisance to do diffs of source code that cross the

Re: Higher abstraction level for calling C functions

2012-01-30 Thread Denis Shelomovskij
30.01.2012 4:42, Timon Gehr пишет: I suppose the unary + before the second 'num' is required to disambiguate from which array length 'num' will be deduced? Shouldn't this restriction be lifted? (Obviously, if the lengths have to match, both are fine.) Yes, this restriction isn't necessary. I

Re: Higher abstraction level for calling C functions

2012-01-30 Thread Denis Shelomovskij
30.01.2012 8:59, Kagamin пишет: static assert(__traits(compiles, HANDLE.init is null)); hmm... What declaration of HANDLE do you use? Wrapper knows nothing about non-standard types, but in `CreateFileW` the last argument is `__(in?) HANDLE hTemplateFile`, so it is an optional parameter (can

Re: cent and ucent?

2012-01-30 Thread Walter Bright
On 1/29/2012 10:39 PM, H. S. Teoh wrote: Interesting. How would D fare in that kind of environment, I wonder? I suppose it shouldn't be a big deal, since you have to custom rewrite everything anyways -- just use int32 throughout. You could write a custom D compiler for it.

Re: Why not allow people to submit name:url associations for dman?

2012-01-30 Thread Walter Bright
On 1/30/2012 12:04 AM, Bernard Helyer wrote: I've found myself using dman more than I thought I would, but it is a little annoying when it fails to find a page and I navigate to it manually -- I wouldn't mind if I could improve dman for the next release. Perhaps a text file on GitHub we could

Re: indent style for D

2012-01-30 Thread Walter Bright
On 1/30/2012 2:16 AM, Denis Shelomovskij wrote: P.S. I started this thread because of wasting my time for conversion/checking and inconsistent situation: druntime/Phobos have both spaces/tabs now (yes, there are significantly more spaces, but it doesn't reduce the problem), e.g. you just broke

Compile time filesystem access?

2012-01-30 Thread Manu
Is D capable of accessing the filesystem at compile time, for instance, to load and parse an XML DOM, or some other structural metadata, which may be used to generate the associative struct and its members? I can think of many other uses for the technology too. It seems extremely powerful, and I'm

Re: Compile time filesystem access?

2012-01-30 Thread Andrej Mitrovic
Only with `enum xmldata = import(file.xml);`, but you have to pass the -J switch and a directory path for the location of the file. E.g.: module test; enum xmldata = import(file.xml); void parse(string data)() { } void main() { parse!(xmldata)(); } $ dmd -J. test.d . is short for the

Re: Compile time filesystem access?

2012-01-30 Thread Andrej Mitrovic
Rather short docs since it's a simple feature: http://www.d-programming-language.org/expression.html#ImportExpression

Re: Compile time filesystem access?

2012-01-30 Thread Vladimir Panteleev
On Monday, 30 January 2012 at 13:23:19 UTC, Manu wrote: Is D capable of accessing the filesystem at compile time, for instance, to load and parse an XML DOM, or some other structural metadata, which may be used to generate the associative struct and its members? I can think of many other uses

Re: Compile time filesystem access?

2012-01-30 Thread Manu
On 30 January 2012 15:30, Vladimir Panteleev vladi...@thecybershadow.netwrote: On Monday, 30 January 2012 at 13:23:19 UTC, Manu wrote: Is D capable of accessing the filesystem at compile time, for instance, to load and parse an XML DOM, or some other structural metadata, which may be used to

Re: Compile time filesystem access?

2012-01-30 Thread David Nadlinger
Be careful, though, the import expression (understandably) expects a compile-time string, which means that you can't directly use it from CTFE (e.g. to open additional files included by the IDL file you are parsing), but instead have to go back to compile-time land and then pass the contents

Re: Compile time filesystem access?

2012-01-30 Thread Manu
On 30 January 2012 15:41, Manu turkey...@gmail.com wrote: On 30 January 2012 15:30, Vladimir Panteleev vladi...@thecybershadow.netwrote: On Monday, 30 January 2012 at 13:23:19 UTC, Manu wrote: Is D capable of accessing the filesystem at compile time, for instance, to load and parse an

Re: Compile time filesystem access?

2012-01-30 Thread Gor Gyolchanyan
Hear hear! How I understand what you mean! I just wanna freakin' look at it, but build a legitimate magical mystery toy with endless possibilities! On Mon, Jan 30, 2012 at 6:24 PM, Manu turkey...@gmail.com wrote: On 30 January 2012 15:41, Manu turkey...@gmail.com wrote: On 30 January 2012

Re: Compile time filesystem access?

2012-01-30 Thread Adam D. Ruppe
On Monday, 30 January 2012 at 14:24:32 UTC, Manu wrote: I want to know if a library is present, and automatically disable non-vital features if it isn't. I'd like it too... here's what I tried. It doesn't work, though. === void libraryTest(string lib)() { mixin(import ~ lib ~ ;); } template

Re: Higher abstraction level for calling C functions

2012-01-30 Thread Kagamin
On Monday, 30 January 2012 at 10:53:17 UTC, Denis Shelomovskij wrote: 30.01.2012 8:59, Kagamin пишет: static assert(__traits(compiles, HANDLE.init is null)); hmm... What declaration of HANDLE do you use? Wrapper knows nothing about non-standard types, but in `CreateFileW` the last argument

Re: Higher abstraction level for calling C functions

2012-01-30 Thread Kagamin
On Monday, 30 January 2012 at 15:51:40 UTC, Kagamin wrote: On Monday, 30 January 2012 at 10:53:17 UTC, Denis Shelomovskij wrote: 30.01.2012 8:59, Kagamin пишет: static assert(__traits(compiles, HANDLE.init is null)); hmm... What declaration of HANDLE do you use? Wrapper knows nothing about

Re: cent and ucent?

2012-01-30 Thread Timon Gehr
On 01/30/2012 03:59 AM, H. S. Teoh wrote: On Sun, Jan 29, 2012 at 05:48:40PM -0800, Walter Bright wrote: On 1/29/2012 2:26 PM, Jonathan M Davis wrote: long double is 128-bit. Sort of. It's 80 bits of useful data with 48 bits of unused padding. Really?! Ugh. Hopefully D handles it better?

Re: indent style for D

2012-01-30 Thread Kagamin
On Monday, 30 January 2012 at 10:16:36 UTC, Denis Shelomovskij wrote: I started this thread Poor topicstarter. His topic is hijacked and buried if flame, and he himself is sent to oblivion.

Re: Compile time filesystem access?

2012-01-30 Thread bls
On 01/30/2012 07:18 AM, Adam D. Ruppe wrote: On Monday, 30 January 2012 at 14:24:32 UTC, Manu wrote: I want to know if a library is present, and automatically disable non-vital features if it isn't. I'd like it too... here's what I tried. It doesn't work, though. I am afraid I miss the

Re: Compile time filesystem access?

2012-01-30 Thread Manu
On 30 January 2012 18:11, bls bizp...@orange.fr wrote: On 01/30/2012 07:18 AM, Adam D. Ruppe wrote: On Monday, 30 January 2012 at 14:24:32 UTC, Manu wrote: I want to know if a library is present, and automatically disable non-vital features if it isn't. I'd like it too... here's what I

unittest ddoc.

2012-01-30 Thread Gor Gyolchanyan
I noticed, that a great way to document code is to put the contents of its unittest in an example block of the respective ddoc: /** * Transmogrifies an integer. * Params: * integer = The integer, that will be transmogrified. * Returns: * The transmogrified version of the

Module detection [Was: Compile time filesystem access?]

2012-01-30 Thread David Nadlinger
On 1/30/12 3:24 PM, Manu wrote: Here's another one I'm endlessly wishing I had in C. I want to know if a library is present, and automatically disable non-vital features if it isn't. It shits me to tears when I can't build something because a non-vital dependant lib is not available for a given

Re: unittest ddoc.

2012-01-30 Thread David Nadlinger
On 1/30/12 5:39 PM, Gor Gyolchanyan wrote: Wouldn't it be great if the compiler inserted the body of the unittest ino the ddoc as an example? At least for me, unit tests tend to be more complex/convoluted than example code, because they cover different edge cases, etc., so I'd rather go the

Re: Compile time filesystem access?

2012-01-30 Thread Timon Gehr
On 01/30/2012 04:18 PM, Adam D. Ruppe wrote: On Monday, 30 January 2012 at 14:24:32 UTC, Manu wrote: I want to know if a library is present, and automatically disable non-vital features if it isn't. I'd like it too... here's what I tried. It doesn't work, though. === void libraryTest(string

Re: cent and ucent?

2012-01-30 Thread Marco Leise
Am 30.01.2012, 03:59 Uhr, schrieb H. S. Teoh hst...@quickfur.ath.cx: On Sun, Jan 29, 2012 at 05:48:40PM -0800, Walter Bright wrote: On 1/29/2012 2:26 PM, Jonathan M Davis wrote: long double is 128-bit. Sort of. It's 80 bits of useful data with 48 bits of unused padding. Really?! Ugh.

Re: cent and ucent?

2012-01-30 Thread H. S. Teoh
On Mon, Jan 30, 2012 at 05:00:22PM +0100, Timon Gehr wrote: On 01/30/2012 03:59 AM, H. S. Teoh wrote: On Sun, Jan 29, 2012 at 05:48:40PM -0800, Walter Bright wrote: On 1/29/2012 2:26 PM, Jonathan M Davis wrote: long double is 128-bit. Sort of. It's 80 bits of useful data with 48 bits of

Re: Compile time filesystem access?

2012-01-30 Thread Marco Leise
Am 30.01.2012, 15:24 Uhr, schrieb Manu turkey...@gmail.com: Here's another one I'm endlessly wishing I had in C. I want to know if a library is present, and automatically disable non-vital features if it isn't. It shits me to tears when I can't build something because a non-vital dependant

Re: unittest ddoc.

2012-01-30 Thread Marco Leise
Am 30.01.2012, 17:45 Uhr, schrieb David Nadlinger s...@klickverbot.at: On 1/30/12 5:39 PM, Gor Gyolchanyan wrote: Wouldn't it be great if the compiler inserted the body of the unittest ino the ddoc as an example? Yeah the idea is reaching far back. At least for me, unit tests tend to be

Re: Compile time filesystem access?

2012-01-30 Thread Manu
On 30 January 2012 19:30, Marco Leise marco.le...@gmx.de wrote: Am 30.01.2012, 15:24 Uhr, schrieb Manu turkey...@gmail.com: Here's another one I'm endlessly wishing I had in C. I want to know if a library is present, and automatically disable non-vital features if it isn't. It shits me to

Re: unittest ddoc.

2012-01-30 Thread Don Clugston
On 30/01/12 18:35, Marco Leise wrote: Am 30.01.2012, 17:45 Uhr, schrieb David Nadlinger s...@klickverbot.at: On 1/30/12 5:39 PM, Gor Gyolchanyan wrote: Wouldn't it be great if the compiler inserted the body of the unittest ino the ddoc as an example? Yeah the idea is reaching far back. At

Re: Compile time filesystem access?

2012-01-30 Thread Iain Buclaw
On 30 January 2012 17:48, Manu turkey...@gmail.com wrote: On 30 January 2012 19:30, Marco Leise marco.le...@gmx.de wrote: Am 30.01.2012, 15:24 Uhr, schrieb Manu turkey...@gmail.com: Here's another one I'm endlessly wishing I had in C. I want to know if a library is present, and automatically

Re: cent and ucent?

2012-01-30 Thread Don Clugston
On 30/01/12 18:06, Marco Leise wrote: Am 30.01.2012, 03:59 Uhr, schrieb H. S. Teoh hst...@quickfur.ath.cx: On Sun, Jan 29, 2012 at 05:48:40PM -0800, Walter Bright wrote: On 1/29/2012 2:26 PM, Jonathan M Davis wrote: long double is 128-bit. Sort of. It's 80 bits of useful data with 48 bits of

Re: Compile time filesystem access?

2012-01-30 Thread Manu
On 30 January 2012 20:03, Iain Buclaw ibuc...@ubuntu.com wrote: On 30 January 2012 17:48, Manu turkey...@gmail.com wrote: Exactly, and nobody I've ever met has either. They just seem to exist, magically appeared out of nowhere in all major linux projects that have existed for 20 years or

Re: unittest ddoc.

2012-01-30 Thread Don Clugston
On 30/01/12 19:28, Marco Leise wrote: Am 30.01.2012, 18:55 Uhr, schrieb Don Clugston d...@nospam.com: OR: /** optionally explain what this test is doing */ unittest { } Not bad. So a documented unittest would be turned into an example section with optinally explain what this test is

Re: Compile time filesystem access?

2012-01-30 Thread Jacob Carlborg
On 2012-01-30 18:48, Manu wrote: On 30 January 2012 19:30, Marco Leise marco.le...@gmx.de mailto:marco.le...@gmx.de wrote: Am 30.01.2012, 15:24 Uhr, schrieb Manu turkey...@gmail.com mailto:turkey...@gmail.com: Here's another one I'm endlessly wishing I had in C. I want

Re: Compile time filesystem access?

2012-01-30 Thread Marco Leise
Aren't those configure scripts generate by some other tool :) Maybe. I never digged that deep into build processes. After some time I got myself to write Makefiles, but that's about it. I see names like automake, m4, configure etc. pop up now and then and have no idea what role each

Re: Compile time filesystem access?

2012-01-30 Thread Danni Coy
configure scripts are usually part of the automake build system which used to be the standard on linux maybe 5 years ago I think it went out of favour roughly the same time as cvs. On Tue, Jan 31, 2012 at 5:29 AM, Marco Leise marco.le...@gmx.de wrote: Aren't those configure scripts generate by

Re: unittest ddoc.

2012-01-30 Thread Felix Hufnagel
+1

Re: Compile time filesystem access?

2012-01-30 Thread Peter Alexander
On Monday, 30 January 2012 at 13:23:19 UTC, Manu wrote: Is D capable of accessing the filesystem at compile time, for instance, to load and parse an XML DOM, or some other structural metadata, which may be used to generate the associative struct and its members? I can think of many other uses

Re: Do we need Win95/98/Me support?

2012-01-30 Thread Jordan Miner
On Saturday, 28 January 2012 at 21:39:32 UTC, Andrej Mitrovic wrote: On 1/28/12, Jordan Miner jmin...@gmail.com wrote: But I hope that D will support Windows 2000 for a while. Aren't you already blocked with Win2000 support? http://d.puremagic.com/issues/show_bug.cgi?id=6024 I've been using

[OT] Corona vs Marmalade vs ...?

2012-01-30 Thread Nick Sabalausky
Anyone here have any experience with mobile 2D game engines like Corona or Marmalade? I'm brand-new to this particular branch of gamedev and could use some perspective. All I know is just what's on their respective websites.

Re: [OT] Corona vs Marmalade vs ...?

2012-01-30 Thread F i L
On Tuesday, 31 January 2012 at 01:53:28 UTC, Nick Sabalausky wrote: Anyone here have any experience with mobile 2D game engines like Corona or Marmalade? I'm brand-new to this particular branch of gamedev and could use some perspective. All I know is just what's on their respective websites.

Re: [OT] Corona vs Marmalade vs ...?

2012-01-30 Thread Nick Sabalausky
F i L witte2...@gmail.com wrote in message news:rvhpqadyagpbbobgw...@dfeed.kimsufi.thecybershadow.net... On Tuesday, 31 January 2012 at 01:53:28 UTC, Nick Sabalausky wrote: Anyone here have any experience with mobile 2D game engines like Corona or Marmalade? I'm brand-new to this particular

Re: indent style for D

2012-01-30 Thread Stewart Gordon
On 30/01/2012 02:24, H. S. Teoh wrote: snip And I'd love to have my integer set class be able to use ∪ and ∩ instead of verbose operations like x.union(y) and x.intersection(y). snip My utility library uses | and . Think of the possible values of the type you're creating a set of as being

Re: indent style for D

2012-01-30 Thread H. S. Teoh
On Tue, Jan 31, 2012 at 02:43:57AM +, Stewart Gordon wrote: On 30/01/2012 02:24, H. S. Teoh wrote: snip And I'd love to have my integer set class be able to use ∪ and ∩ instead of verbose operations like x.union(y) and x.intersection(y). snip My utility library uses | and . Think of

Parallel prefix algos D

2012-01-30 Thread bearophile
This post is about many things at the same time. This is a short slides pack about Parallel Prefix Algorithms (but it's not very readable, it's too much succinct): http://ocw.mit.edu/courses/mathematics/18-337j-applied-parallel-computing-sma-5505-spring-2005/lecture-notes/lec4.pdf Not too much

Dlang.org needs a Getting Started page

2012-01-30 Thread Xinok
Just a thought, but I think the official website really needs a Getting Started page for newcomers. This page should make it as effortless as possible by providing all the information and resources needed for one to dive right into D. Not everything needs to be covered by this page, but it

Re: Dlang.org needs a Getting Started page

2012-01-30 Thread Era Scarecrow
On Tuesday, 31 January 2012 at 05:31:47 UTC, Xinok wrote: Just a thought, but I think the official website really needs a Getting Started page for newcomers. This page should make it as effortless as possible by providing all the information and resources needed for one to dive right into D.

Re: unittest ddoc.

2012-01-30 Thread Gor Gyolchanyan
That's what I said in the original message. I proposed to do this only if the unittest has a ddoc comment. :-) On Mon, Jan 30, 2012 at 10:34 PM, Don Clugston d...@nospam.com wrote: On 30/01/12 19:28, Marco Leise wrote: Am 30.01.2012, 18:55 Uhr, schrieb Don Clugston d...@nospam.com: OR: /**

Re: Partial classes

2012-01-30 Thread bls
On 01/29/2012 01:43 PM, Mars wrote: Hello everybody. Quick question, is there anything like C#'s partial classes in D? Mars As already said template mixins are close to partial classes. A snippet. HTH import std.stdio, std.cstream; void main(string[] args) { auto bar = new Bar();

combine different data type

2012-01-30 Thread sami
when i do that auto x = [1, ha]; i have an error Error: incompatible types for ((1) ? (hgh)): 'int' and 'string' if there any method to combine different data type?

Chained Catch Statements

2012-01-30 Thread Jared
In Java and C++, I can do something to the effect of: try { //Some code } catch (Exception1) { } catch (Exception2) { } //etc... However, this doesn't seem to be possible in D. What is the idiom for handling a case where multiple exceptions of different types may be thrown?

Re: Chained Catch Statements

2012-01-30 Thread Trass3r
What is the idiom for handling a case where multiple exceptions of different types may be thrown? I think you could catch a common baseclass like Exception and test if it's a specific Exception by casting.

Re: Chained Catch Statements

2012-01-30 Thread Adam D. Ruppe
On Monday, 30 January 2012 at 14:37:19 UTC, Jared wrote: In Java and C++, I can do something to the effect of: That works in D too. I believe it does it linearly though, so it will use the first catch that matches. try {} catch (Exception e) {} // most throwable objects derive from

Compile Time Printing

2012-01-30 Thread Blake Anderton
So from what I've found searching the newsgroup and my own experimentation, the best way to accomplish compile time printing is to do something like this: string ctMain() { //evaluate and return the final result string } enum result = ctMain(); pragma(msg, result); I'm not a fan of having

Re: Chained Catch Statements

2012-01-30 Thread Jared
I suppose that works, though it does seem a little hackish (and I'm pretty sure it's considered bad form in Java). What was the line of reasoning for omitting this (to me, at least) extremely useful construct?

Re: Chained Catch Statements

2012-01-30 Thread Mantis
30.01.2012 16:37, Jared пишет: However, this doesn't seem to be possible in D. Why not? import std.stdio; class Exception1 : Throwable { this( string s ) { super( s ); } } class Exception2 : Throwable { this( string s ) { super( s ); } } void foo() { throw new Exception1( foo ); } void

Re: combine different data type

2012-01-30 Thread Simen Kjærås
On Mon, 30 Jan 2012 13:58:38 +0100, sami s...@hotmail.com wrote: when i do that auto x = [1, ha]; i have an error Error: incompatible types for ((1) ? (hgh)): 'int' and 'string' if there any method to combine different data type? You might want to check out std.variant. It's Variant type

sub() in D2?

2012-01-30 Thread adamss3
Is there a direct analog to sub() in D2? The replace() function in regex seems a bit overkill for what I need. I just want to substitute one string for another.

Re: combine different data type

2012-01-30 Thread Daniel Murphy
Simen Kjærås simen.kja...@gmail.com wrote in message news:op.v8wj38qf0gp...@biotronic.lan... On Mon, 30 Jan 2012 13:58:38 +0100, sami s...@hotmail.com wrote: when i do that auto x = [1, ha]; i have an error Error: incompatible types for ((1) ? (hgh)): 'int' and 'string' if there any method

Re: sub() in D2?

2012-01-30 Thread Adam D. Ruppe
http://www.d-programming-language.org/phobos/std_array.html#replace import std.array; string a = test; string b = a.replace(t, p); assert(b == pesp);

Re: sub() in D2?

2012-01-30 Thread adamss3
Thanks.

RPC module for D ?

2012-01-30 Thread luis
There are any RPC module for D ??

Re: RPC module for D ?

2012-01-30 Thread David Nadlinger
On 1/30/12 5:27 PM, luis wrote: There are any RPC module for D ?? I implemented support for Apache Thrift during last summer's GSoC, it's currently under review for inclusion into Thrift trunk: http://klickverbot.at/code/gsoc/thrift/ David

Re: Chained Catch Statements

2012-01-30 Thread Alex Rønne Petersen
On 30-01-2012 15:37, Jared wrote: In Java and C++, I can do something to the effect of: try { //Some code } catch (Exception1) { } catch (Exception2) { } //etc... However, this doesn't seem to be possible in D. What is the idiom for handling a case where multiple exceptions of different

Re: Chained Catch Statements

2012-01-30 Thread Era Scarecrow
On Monday, 30 January 2012 at 14:50:23 UTC, Adam D. Ruppe wrote: On Monday, 30 January 2012 at 14:37:19 UTC, Jared wrote: In Java and C++, I can do something to the effect of: That works in D too. I believe it does it linearly though, so it will use the first catch that matches. try {}

Re: Chained Catch Statements

2012-01-30 Thread Andrej Mitrovic
On 1/30/12, Era Scarecrow rtcv...@yahoo.com wrote: To me this seems like a mistake. You could throw SpecialException in the handler for Exception. So it's legal code.

Re: Compile Time Printing

2012-01-30 Thread bearophile
Blake Anderton: I know a ctwriteln never really caught on, There is an open pull request about it. And I think we'll have it in D. A problem is, that ctwriteln too adds a newline... :-( Bye, bearophile

Re: Chained Catch Statements

2012-01-30 Thread Era Scarecrow
On Monday, 30 January 2012 at 17:17:46 UTC, Andrej Mitrovic wrote: On 1/30/12, Era Scarecrow rtcv...@yahoo.com wrote: To me this seems like a mistake. You could throw SpecialException in the handler for Exception. So it's legal code. Yes, thanks to inheritance it is legal code. However

Re: RPC module for D ?

2012-01-30 Thread Jacob Carlborg
On 2012-01-30 17:27, luis wrote: There are any RPC module for D ?? The Mango project has some support for RPC. But this if for D1 with Tango: http://dsource.org/projects/mango -- /Jacob Carlborg

Re: Chained Catch Statements

2012-01-30 Thread Jesse Phillips
On Monday, 30 January 2012 at 18:23:56 UTC, Era Scarecrow wrote: try { } catch (Throwable t) { } catch {Exception e) { //never executed } catch (StreamException st) { //never executed } //and the list can go on forever. See the problem? No? Error: catch at test.d(3) hides catch at

Re: Chained Catch Statements

2012-01-30 Thread Era Scarecrow
On Monday, 30 January 2012 at 19:25:03 UTC, Jesse Phillips wrote: On Monday, 30 January 2012 at 18:23:56 UTC, Era Scarecrow wrote: try { } catch (Throwable t) { } catch {Exception e) { //never executed } catch (StreamException st) { //never executed } //and the list can go on forever. See

Re: RPC module for D ?

2012-01-30 Thread Zardoz
I will try it. I only need to make a remote hello world , do a short description , and compare with other RPCs in other 3 languages (university homework...) . On Mon, 30 Jan 2012 17:30:59 +0100, David Nadlinger wrote: On 1/30/12 5:27 PM, luis wrote: There are any RPC module for D ?? I

Re: Pure Contract bug? (unnecessarily strict)

2012-01-30 Thread Jesse Phillips
On Sunday, 29 January 2012 at 06:22:26 UTC, Era Scarecrow wrote: Maybe someone's brought this up, but i seem to have the compiler complaining to me that my function isn't 'pure' by calling a non-pure function, specifically to!string(). I don't see why this couldn't be done, not only does it

Re: Pure Contract bug? (unnecessarily strict)

2012-01-30 Thread Era Scarecrow
I don't see why this couldn't be done, not only does it get not exist in release, it shouldn't be changing variables in non-release. As mentioned there is a hole for debug code. Report it: http://d.puremagic.com/issues/ and we'll see what happens with that. Reported; Minor priority (Won't

Re: RPC module for D ?

2012-01-30 Thread Zardoz
On Mon, 30 Jan 2012 17:30:59 +0100, David Nadlinger wrote: On 1/30/12 5:27 PM, luis wrote: There are any RPC module for D ?? I implemented support for Apache Thrift during last summer's GSoC, it's currently under review for inclusion into Thrift trunk:

Re: sub() in D2?

2012-01-30 Thread Marco Leise
Am 30.01.2012, 16:57 Uhr, schrieb adamss3 sadam...@woh.rr.com: Thanks. The only downside of strings being arrays: a lot of typical string functions are in std.array. :D

Re: RPC module for D ?

2012-01-30 Thread David Nadlinger
On 1/30/12 11:35 PM, Zardoz wrote: I try to build it and when i did make check to see it all works I get two fails : […] Oh, I'm afraid you caught me in a bad moment – because the version for upstream integration is frozen at Thrift's JIRA, I've been a bit more careless with multi-platform

Re: RPC module for D ?

2012-01-30 Thread Zardoz
On Tue, 31 Jan 2012 00:17:18 +0100, David Nadlinger wrote: On 1/30/12 11:35 PM, Zardoz wrote: I try to build it and when i did make check to see it all works I get two fails : […] Oh, I'm afraid you caught me in a bad moment – because the version for upstream integration is frozen at

Re: RPC module for D ?

2012-01-30 Thread David Nadlinger
On 1/31/12 12:29 AM, Zardoz wrote: At least I can say that the Tutorial client server works (async_client not compile) :) . For me it's enough . Because you don't have libevent installed (the tutorial makefile doesn't have detection for that by design), or do you encounter another error?

Re: Chained Catch Statements

2012-01-30 Thread Andrej Mitrovic
On 1/30/12, Era Scarecrow rtcv...@yahoo.com wrote: If the compiler reorders the blocks for you A warning, maybe. But I'm against compilers which try to be too smart and rewrite code to change its semantics. If there's something wrong with my code I want to know about it (warning or error) and

Re: Chained Catch Statements

2012-01-30 Thread Jonathan M Davis
On Tuesday, January 31, 2012 01:05:20 Andrej Mitrovic wrote: On 1/30/12, Era Scarecrow rtcv...@yahoo.com wrote: If the compiler reorders the blocks for you A warning, maybe. But I'm against compilers which try to be too smart and rewrite code to change its semantics. If there's something

Re: Chained Catch Statements

2012-01-30 Thread bearophile
Jonathan M Davis: I do think that having the compiler complain when one catch block hides another makes a lot of sense, but I think that that's as far as it should go. It's the programmer's job to fix their code, not the compiler's. I agree. Do we create a new diagnostic enhancement request

About to!int

2012-01-30 Thread bearophile
In Python int() and float() convert a string into a number even if it contains some whitespace before and after the number: s = 12\n int(s) 12 float(s) 12.0 In D to!int( 12\n) gives a run-time error. So time ago I have weakly asked Andrei to change to!int, to let it ignore leading and

Re: Chained Catch Statements

2012-01-30 Thread Era Scarecrow
I see no reason why the compiler should be reordering anything here. That changes the semantics of the code. It's not like it's a great burden on the programmer to just reorder the blocks so that they're in the correct order. Having the compiler give a warning or error would be plenty, and a

Re: sub() in D2?

2012-01-30 Thread Jacob Carlborg
On 2012-01-31 00:09, Marco Leise wrote: Am 30.01.2012, 16:57 Uhr, schrieb adamss3 sadam...@woh.rr.com: Thanks. The only downside of strings being arrays: a lot of typical string functions are in std.array. :D If everything in std.array works for strings as well, shouldn't std.string

Re: sub() in D2?

2012-01-30 Thread Jonathan M Davis
On Tuesday, January 31, 2012 08:16:25 Jacob Carlborg wrote: On 2012-01-31 00:09, Marco Leise wrote: Am 30.01.2012, 16:57 Uhr, schrieb adamss3 sadam...@woh.rr.com: Thanks. The only downside of strings being arrays: a lot of typical string functions are in std.array. :D If everything

Re: About to!int

2012-01-30 Thread Zardoz
On Mon, 30 Jan 2012 21:01:38 -0500, bearophile wrote: In D to!int( 12\n) gives a run-time error. So time ago I have weakly asked Andrei to change to!int, to let it ignore leading and trailing whitespace, but he has ignored my request. A leading newline comes often from input

[Issue 7398] New: spell checker should suppress error messages

2012-01-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7398 Summary: spell checker should suppress error messages Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2

[Issue 7375] Regression(2.057): Invalid downcast permitted with derived/aliased template classes

2012-01-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7375 --- Comment #3 from Walter Bright bugzi...@digitalmars.com 2012-01-30 01:20:02 PST --- The failure definitely happened between 2.056 and 2.057. Anyone care to run the git binary diff thing? -- Configure issuemail:

  1   2   >