Re: OSCON 2012 session: Generic Programming Galore using D

2012-04-04 Thread deadalnix
Le 03/04/2012 16:59, Andrei Alexandrescu a écrit : On 4/3/12 9:42 AM, Jacob Carlborg wrote: On 2012-04-03 16:30, Andrei Alexandrescu wrote: I'm glad to announce that OSCON 2012 (http://oscon.com/oscon2012) has approved my session proposal Generic Programming Galore using D. Hope to see many

Re: Mono-D 0.3.5

2012-04-04 Thread Joshua Niehus
On Monday, 26 March 2012 at 23:57:27 UTC, alex wrote: Couple of bug fixes + new refactoring feature: [snip] Got it up and running on my Mac. Awesome job, thanks josh

Re: Mono-D 0.3.5

2012-04-04 Thread alex
On Tuesday, 3 April 2012 at 21:55:14 UTC, akaz wrote: Why Mono-D cannot be convinced to create such a simple compilation line? Because I've never used gdc before to compile D programs. I probably should do more testing concerning toolchains etc. Anyway thanks for the feedback, I'll add

Re: D Conference 2012: call for speakers

2012-04-04 Thread Jonathan M Davis
On Friday, March 16, 2012 12:46:41 Walter Bright wrote: (The conference is in Astoria, Oregon, Sept 26-29 at The Banker's Suite Ballroom. Still working on the web site.) Is there something you're doing with D that is just begging to be shared? Do a talk at the D conference! Talks are either

Re: Mono-D 0.3.5

2012-04-04 Thread Jacob Carlborg
On 2012-04-03 23:55, akaz wrote: I need some help with Mono-D. I am on Linux 64 and I try to use both DMD 2.958 and GDC-4.6.3 However, I find difficult to: -the GDC toolchain keeps passing some unknown parameters to the compiler: for example, for the Debug ARguments-Executable, the passed

Re: D Conference 2012

2012-04-04 Thread Steven Schveighoffer
On Tue, 27 Mar 2012 17:29:08 -0400, Walter Bright newshou...@digitalmars.com wrote: The web site is up now: http://www.astoriaseminar.com See you all there! Any chance we can search for treasure while there? I wish it was closer, and/or I was doing less vacation this year so I

Re: Mono-D 0.3.5

2012-04-04 Thread akaz
These are the flags used by DMD. If you can point Mono-D to gdmd instead of gdc it might work. gdmd is a wrapper around gdc that convert dmd flags to gdc flags. I cannot. GDMD toolchain is not even present among those in Mono-D. OTOH, I still do not know how to pass -lortp regular flag to

Re: Mono-D 0.3.5

2012-04-04 Thread alex
On Wednesday, 4 April 2012 at 15:02:02 UTC, akaz wrote: These are the flags used by DMD. If you can point Mono-D to gdmd instead of gdc it might work. gdmd is a wrapper around gdc that convert dmd flags to gdc flags. I cannot. GDMD toolchain is not even present among those in Mono-D. OTOH,

Re: Russian TDPL is available for orders

2012-04-04 Thread Vladimir Panteleev
On Tuesday, 3 April 2012 at 00:09:02 UTC, Denis Shelomovskij wrote: I was afraid of it and it has finally happened. Sorry, but there is only *bad* news for us. Hi, The text was revised by Igor Stepanov and myself. We are both D users, but inevitably a few errors will slip through the cracks.

Re: Oracle Database - ocilib

2012-04-04 Thread dnewbie
On Tuesday, 3 April 2012 at 04:01:07 UTC, dnewbie wrote: It also works on Linux (I've just tested it on Debian Squeeze with Oracle Express) Rock'n'roll! Hi. I'd like to submit these bindings to be reviewed for inclusion in Deimos.

Re: Russian TDPL is available for orders

2012-04-04 Thread Dmitry Olshansky
On 04.04.2012 19:35, Vladimir Panteleev wrote: On Tuesday, 3 April 2012 at 00:09:02 UTC, Denis Shelomovskij wrote: I was afraid of it and it has finally happened. Sorry, but there is only *bad* news for us. Hi, The text was revised by Igor Stepanov and myself. We are both D users, but

Re: Russian TDPL is available for orders

2012-04-04 Thread Igor Stepanov
The ones I recall in chapter 13 (and the only available for preview): с. 471 ...вплоть до массовой памяти лучше уж дисковой, звучит проще и сомнений меньше. Все таки имелась в виду не дисковая память, а ОЗУ. Можно ли назвать ее регулярной? на с.474 есть просто отличное предложение: По

Re: Russian TDPL is available for orders

2012-04-04 Thread Dmitry Olshansky
On 04.04.2012 22:56, Igor Stepanov wrote: The ones I recall in chapter 13 (and the only available for preview): с. 471 ...вплоть до массовой памяти лучше уж дисковой, звучит проще и сомнений меньше. Все таки имелась в виду не дисковая память, а ОЗУ. Можно ли назвать ее регулярной? Глядя на

Re: Russian TDPL is available for orders

2012-04-04 Thread Andrei Alexandrescu
On 4/4/12 1:46 PM, Dmitry Olshansky wrote: Andrei, may I ask you what kind of memory you had in mind when refereed to mass storage in this statement of TDPL? Disk/SSD, not RAM. Andrei

Re: traits getProtection

2012-04-04 Thread deadalnix
Le 04/04/2012 04:48, Jonathan M Davis a écrit : On Tuesday, April 03, 2012 08:23:49 deadalnix wrote: Le 02/04/2012 22:59, Simen Kjærås a écrit : On Mon, 02 Apr 2012 20:02:20 +0200, deadalnixdeadal...@gmail.com wrote: Now, there are a number of people very unhappy about this state of affairs

Re: traits getProtection

2012-04-04 Thread deadalnix
Le 04/04/2012 03:04, Robert Jacques a écrit : On Tue, 03 Apr 2012 08:30:25 -0500, Adam D. Ruppe destructiona...@gmail.com wrote: On Tuesday, 3 April 2012 at 13:14:00 UTC, Robert Jacques wrote: As someone who has implemented a runtime reflection library in D, it is entirely possible to detect

Re: DIP16: Transparently substitute module with package

2012-04-04 Thread deadalnix
Le 03/04/2012 19:44, Martin Nowak a écrit : On Fri, 30 Mar 2012 16:46:19 +0200, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Starting a new thread from one in announce: http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP16 Please comment, after which Walter will approve.

Re: Nested functions should be exempt from sequential visibility rules

2012-04-04 Thread Don Clugston
On 03/04/12 07:38, Nick Sabalausky wrote: Regarding this: http://d.puremagic.com/issues/show_bug.cgi?id=790 I submit that nested functions should be exempt from the usual sequential visibility rules. (Therefore, mutually recursive nested functions would become possible.) Or at the very

Re: traits getProtection

2012-04-04 Thread Jonathan M Davis
On Wednesday, April 04, 2012 09:04:41 deadalnix wrote: Le 04/04/2012 04:48, Jonathan M Davis a écrit : On Tuesday, April 03, 2012 08:23:49 deadalnix wrote: Le 02/04/2012 22:59, Simen Kjærås a écrit : On Mon, 02 Apr 2012 20:02:20 +0200, deadalnixdeadal...@gmail.com wrote: Now, there are

Re: GSoC 2012 Proposal: Continued Work on a D Linear Algebra library (SciD - std.linalg)

2012-04-04 Thread Michael Chen
For the Point 4, I really like to have high order functions like reduceRow and reduceCol. then the function argument is simply the reduceRow!foo(0,mat), here the foo is not a function operating on the whole column but simply a function of two elements (e.g. reduceRow!(a+b)(0,mat)). Or even better

Re: Cross-references in generated ddoc

2012-04-04 Thread Jacob Carlborg
On 2012-04-04 07:38, Ary Manzana wrote: Hi all, I just submitted a pull request that makes ddoc generate cross-references... even for templates! https://github.com/D-Programming-Language/dmd/pull/865 It would be awesome if you can try it with your projects, see if it's working properly and

Re: COM in D (Was: D for a Qt developer)

2012-04-04 Thread Paulo Pinto
Well, since Windows 2000 the amount of COM only APIs have been increasing, so most languages have to have some kind of COM bindings. I really find nice that D offers such integration with COM. -- Paulo Nick Sabalausky wrote in message news:jle3ug$2o70$1...@digitalmars.com... Jesse Phillips

Re: Cross-references in generated ddoc

2012-04-04 Thread Ary Manzana
On 4/4/12 6:35 PM, Jacob Carlborg wrote: On 2012-04-04 07:38, Ary Manzana wrote: Hi all, I just submitted a pull request that makes ddoc generate cross-references... even for templates! https://github.com/D-Programming-Language/dmd/pull/865 It would be awesome if you can try it with your

Re: Cross-references in generated ddoc

2012-04-04 Thread Jacob Carlborg
On 2012-04-04 13:38, Ary Manzana wrote: Ah, no. That's because I ran it against object.di, which doesn't have ddoc comments at all. I don't generate cross-references to undocumented symbols. I uploaded a new version which I ran against an object.di which has empty ddocs for everything. Now you

Re: [OT] Just curious: What's this algorithm's name?

2012-04-04 Thread Manfred Nowak
Nick Sabalausky wrote: in cases where the computation stops recursing when it gets back to itself May be you mean APSP = all pairs shortest path In your case: - get rid of all uneven numbered edges - reverse the remaining edges - compute APSP, where addition is replaced by concatnation -

Re: Cross-references in generated ddoc

2012-04-04 Thread Ary Manzana
On 4/4/12 8:05 PM, Jacob Carlborg wrote: On 2012-04-04 13:38, Ary Manzana wrote: Ah, no. That's because I ran it against object.di, which doesn't have ddoc comments at all. I don't generate cross-references to undocumented symbols. I uploaded a new version which I ran against an object.di

Re: Cross-references in generated ddoc

2012-04-04 Thread Ary Manzana
On 4/4/12 9:53 PM, Ary Manzana wrote: On 4/4/12 8:05 PM, Jacob Carlborg wrote: On 2012-04-04 13:38, Ary Manzana wrote: Ah, no. That's because I ran it against object.di, which doesn't have ddoc comments at all. I don't generate cross-references to undocumented symbols. I uploaded a new

Re: Cross-references in generated ddoc

2012-04-04 Thread David Gileadi
On 4/3/12 10:38 PM, Ary Manzana wrote: Hi all, I just submitted a pull request that makes ddoc generate cross-references... even for templates! https://github.com/D-Programming-Language/dmd/pull/865 It would be awesome if you can try it with your projects, see if it's working properly and

Re: DIP16: Transparently substitute module with package

2012-04-04 Thread Steven Schveighoffer
On Mon, 02 Apr 2012 20:44:09 -0400, Michel Fortin michel.for...@michelf.com wrote: On 2012-04-02 13:04:31 +, Steven Schveighoffer schvei...@yahoo.com said: On Fri, 30 Mar 2012 17:45:36 -0400, Michel Fortin The problem is that if .std.algorithm.package contains a sort function and

Re: Cross-references in generated ddoc

2012-04-04 Thread Ary Manzana
On 4/4/12 10:00 PM, David Gileadi wrote: On 4/3/12 10:38 PM, Ary Manzana wrote: Hi all, I just submitted a pull request that makes ddoc generate cross-references... even for templates! https://github.com/D-Programming-Language/dmd/pull/865 It would be awesome if you can try it with your

Re: Cross-references in generated ddoc

2012-04-04 Thread Steven Schveighoffer
On Wed, 04 Apr 2012 01:38:42 -0400, Ary Manzana a...@esperanto.org.ar wrote: Hi all, I just submitted a pull request that makes ddoc generate cross-references... even for templates! https://github.com/D-Programming-Language/dmd/pull/865 It would be awesome if you can try it with your

Re: [OT] Just curious: What's this algorithm's name?

2012-04-04 Thread H. S. Teoh
On Wed, Apr 04, 2012 at 01:33:21AM -0400, Nick Sabalausky wrote: [...] Suppose you have a directed graph, which may have cycles, and you want to compute something for each node. But the final result for each node is dependent on the final results for each of the nodes it points to. (It may

Re: Mono-D GSoC proposal, hopefully the last thread about it

2012-04-04 Thread dsimcha
Yeah, as a mentor, I will reassure both of you that no news definitely isn't bad news and may even be good news. If you don't have any feedback, it's because we either haven't gotten around to reading your proposal yet or it had all the information we wanted and don't have any requests for

Re: Cross-references in generated ddoc

2012-04-04 Thread Jacob Carlborg
On 2012-04-04 15:59, Ary Manzana wrote: Whoa! And take a look at this: http://pancake.io/1e79d0/algorithm.html It's all colorful and linky, even for template if conditions! :-D Thanks for catching that, Jacob. By the way, I think a show source would be nice to have, like what they have in

Re: Cross-references in generated ddoc

2012-04-04 Thread Jacob Carlborg
On 2012-04-04 15:53, Ary Manzana wrote: You are right! I was missing doing cross-reference for template instances. Now I did it, but I was actually forgetting to do cross-references for template instances inside templates. :-P So now I did it. Take a look, much better! :-)

Re: Cross-references in generated ddoc

2012-04-04 Thread Jacob Carlborg
On 2012-04-04 07:38, Ary Manzana wrote: Hi all, I just submitted a pull request that makes ddoc generate cross-references... even for templates! https://github.com/D-Programming-Language/dmd/pull/865 It would be awesome if you can try it with your projects, see if it's working properly and

Re: Cross-references in generated ddoc

2012-04-04 Thread Jacob Carlborg
On 2012-04-04 15:59, Ary Manzana wrote: By the way, I think a show source would be nice to have, like what they have in Ruby... no? It helps you find bugs faster, or understand the code better if the documentation is not precise enough... BTW, I really like the filters in the Ruby

Re: Nested functions should be exempt from sequential visibility rules

2012-04-04 Thread Xinok
On Tuesday, 3 April 2012 at 12:13:00 UTC, Timon Gehr wrote: On 04/03/2012 02:00 PM, Nick Sabalausky wrote: Timon Gehrtimon.g...@gmx.ch wrote in message news:jlej27$mvi$1...@digitalmars.com... This is the right way to work around this issue. It works now and does not imply any kind of

Re: DIP16: Transparently substitute module with package

2012-04-04 Thread Michel Fortin
On 2012-04-04 14:08:34 +, Steven Schveighoffer schvei...@yahoo.com said: On Mon, 02 Apr 2012 20:44:09 -0400, Michel Fortin michel.for...@michelf.com wrote: Whereas if the fully-qualified name of a module becomes ambiguous because of a symbol in another module, there is no way to

Re: Cross-references in generated ddoc

2012-04-04 Thread Jonathan M Davis
On Wednesday, April 04, 2012 22:15:10 Ary Manzana wrote: But when Walter and Andrei generate the docs they use this: https://github.com/D-Programming-Language/d-programming-language.org/blob/ma ster/std.ddoc#L316 If you ask me, that's a bad smell. What if I want to make the docs in my own

Re: DIP16: Transparently substitute module with package

2012-04-04 Thread Steven Schveighoffer
On Wed, 04 Apr 2012 12:33:26 -0400, Michel Fortin michel.for...@michelf.com wrote: On 2012-04-04 14:08:34 +, Steven Schveighoffer schvei...@yahoo.com said: The FQN cannot be ambiguous. Sure it can if I follow DIP16, because module names can become ambiguous. Let's try this with an

Re: traits getProtection

2012-04-04 Thread Jonathan M Davis
On Wednesday, April 04, 2012 15:49:59 deadalnix wrote: Le 04/04/2012 10:41, Jonathan M Davis a écrit : Plus, this isn't a real issue, because the final keyword exists. It's a _huge_ issue, because it means that nearly every single private function in a class in D will need to be marked

Re: Poll of the week - How long have you been in the D world?

2012-04-04 Thread simendsjo
On Wed, 04 Apr 2012 20:27:45 +0200, Don Clugston d...@nospam.com wrote: On 31/03/12 00:29, H. S. Teoh wrote: On Fri, Mar 30, 2012 at 11:17:47PM +0100, Stewart Gordon wrote: On 26/03/2012 02:18, dnewbie wrote: Just out of curiosity, is D attracting new users? Are the old users running? Place

Re: DIP16: Transparently substitute module with package

2012-04-04 Thread Jacob Carlborg
On 2012-04-04 18:33, Michel Fortin wrote: You might think I'm trying to split hair in four to find flaws, that no one is going to do things that dumb, but I unfortunately think the problematic pattern is already quite common. How many times have we seen modules containing a class, variable, or

Re: DIP16: Transparently substitute module with package

2012-04-04 Thread Steven Schveighoffer
On Wed, 04 Apr 2012 14:03:07 -0400, Timon Gehr timon.g...@gmx.ch wrote: On 04/04/2012 07:53 PM, Steven Schveighoffer wrote: OK, but when is it ever valid to refer to a module when the semantic expectations are for something other than a module? I can only think of two places where module names

Re: [OT] Just curious: What's this algorithm's name?

2012-04-04 Thread Nick Sabalausky
H. S. Teoh hst...@quickfur.ath.cx wrote in message news:mailman.1351.1333549896.4860.digitalmar...@puremagic.com... On Wed, Apr 04, 2012 at 01:33:21AM -0400, Nick Sabalausky wrote: [...] Suppose you have a directed graph, which may have cycles, and you want to compute something for each node.

Re: [OT] Just curious: What's this algorithm's name?

2012-04-04 Thread H. S. Teoh
On Wed, Apr 04, 2012 at 05:03:39PM -0400, Nick Sabalausky wrote: H. S. Teoh hst...@quickfur.ath.cx wrote in message news:mailman.1351.1333549896.4860.digitalmar...@puremagic.com... [...] Sounds like the word you want is closure. Now that you mention it, that *does* seem to make sense:

Re: [OT] Just curious: What's this algorithm's name?

2012-04-04 Thread bls
On 04/03/2012 10:33 PM, Nick Sabalausky wrote: Suppose you have a directed graph, which may have cycles, and you want to compute something for each node. But the final result for each node is dependent on the final results for each of the nodes it points to. (It may sound like this would just

Re: GSoC 2012 Proposal: Continued Work on a D Linear Algebra library (SciD - std.linalg)

2012-04-04 Thread Cristi Cobzarenco
Thanks for the feedback! On 4 April 2012 10:21, Michael Chen sth4...@gmail.com wrote: another btw, there is also another great c++ linear algebra library besides Eigen: Amardillo which has very simple matlab like interface and performs on a par with Eigen. I'll look into it, thanks. On

Re: DIP16: Transparently substitute module with package

2012-04-04 Thread Michel Fortin
On 2012-04-04 17:53:24 +, Steven Schveighoffer schvei...@yahoo.com said: But yes, I think the issue really becomes, we need to look at context when deciding the semantic meaning of a symbol. I don't think this violates the context-free grammar, because wouldn't this only come into

Re: traits getProtection

2012-04-04 Thread Martin Nowak
On Mon, 02 Apr 2012 19:10:01 +0200, Jonathan M Davis jmdavisp...@gmx.com wrote: On Monday, April 02, 2012 13:26:05 Dmitry Olshansky wrote: It's all nice and well, but I believe part of the reason of say private protection is that user is never ever able to see(!) it. Thus it user can't

Re: DIP16: Transparently substitute module with package

2012-04-04 Thread Michel Fortin
On 2012-04-04 19:48:32 +, Steven Schveighoffer schvei...@yahoo.com said: On Wed, 04 Apr 2012 14:03:07 -0400, Timon Gehr timon.g...@gmx.ch wrote: No symbol is resolved until semantic, but I don't think hiding the module/package symbol if any clashing symbol in the module/any subpackage

Re: DIP16: Transparently substitute module with package

2012-04-04 Thread Martin Nowak
What happen if both pkg.d and pkg/_.d exists ? If it is not in the same path (think -I compiler option). In one case, this is an issue, in the other this isn't. pkg.d would always be a module, hence result in a module/package conflict. We'd need to directly search for a subdirectory to decide

Re: Poll of the week - How long have you been in the D world?

2012-04-04 Thread Jesse Phillips
On Wednesday, 4 April 2012 at 19:06:30 UTC, simendsjo wrote: There are professional, full-time D1 developers who have _never_ read the newsgroups. They have probably not even heard the news that D1 will be discontinued..? Probably haven't heard there was a new compiler release either.

Re: DIP16: Transparently substitute module with package

2012-04-04 Thread Michel Fortin
On 2012-04-05 00:50:49 +, Michel Fortin michel.for...@michelf.com said: I think we need a third option. Here's an idea: we could allow modules having a single symbol with the same name as the module to behave as if they were the symbol itself, just like templates behaves. For instance:

Re: [OT] Just curious: What's this algorithm's name?

2012-04-04 Thread Nick Sabalausky
H. S. Teoh hst...@quickfur.ath.cx wrote in message news:mailman.1358.1333576694.4860.digitalmar...@puremagic.com... On Wed, Apr 04, 2012 at 05:03:39PM -0400, Nick Sabalausky wrote: H. S. Teoh hst...@quickfur.ath.cx wrote in message

Re: Poll of the week - How long have you been in the D world?

2012-04-04 Thread Don Clugston
On 04/04/12 21:06, simendsjo wrote: On Wed, 04 Apr 2012 20:27:45 +0200, Don Clugston d...@nospam.com wrote: On 31/03/12 00:29, H. S. Teoh wrote: On Fri, Mar 30, 2012 at 11:17:47PM +0100, Stewart Gordon wrote: On 26/03/2012 02:18, dnewbie wrote: Just out of curiosity, is D attracting new

Re: parallel unzip in progress

2012-04-04 Thread Jay Norwood
On Tuesday, 3 April 2012 at 05:27:08 UTC, Jay Norwood wrote: .. So, to answer my own questions ... I placed the code below in a taskpool parallel foreach loop, where each am is an archive member. It is expanded, and the expanded data is written to a file. The original time info is

Re: parallel unzip in progress

2012-04-04 Thread dennis luehring
Am 04.04.2012 08:31, schrieb Jay Norwood: On Tuesday, 3 April 2012 at 05:27:08 UTC, Jay Norwood wrote: .. So, to answer my own questions ... I placed the code below in a taskpool parallel foreach loop, where each am is an archive member. It is expanded, and the expanded data is

Re: parallel unzip in progress

2012-04-04 Thread Jay Norwood
On Wednesday, 4 April 2012 at 07:25:25 UTC, dennis luehring wrote: Am 04.04.2012 08:31, schrieb Jay Norwood: This particular loop is currently excluding restore of times on directory entries, but I suppose I can restore the directory times after all the files have been expanded into the

Re: HelloWordl in Webserver

2012-04-04 Thread Xan
On Tuesday, 3 April 2012 at 13:33:19 UTC, Adam D. Ruppe wrote: On Tuesday, 3 April 2012 at 08:42:01 UTC, Xan wrote: I receive errors: I changed some stuff since the beginning of thi thread. cgi.d now includes a http server without needing the other modules. So if you just get the new cgi.d,

log2 buggy or is a real thing?

2012-04-04 Thread Jonathan M Davis
This progam: import std.math; import std.stdio; import std.typetuple; ulong log2(ulong n) { return n == 1 ? 0 : 1 + log2(n / 2); } void print(ulong value) { writefln(%s: %s %s, value, log2(value), std.math.log2(value)); } void main() { foreach(T; TypeTuple!(byte,

Re: Equivalents to policy classes in D

2012-04-04 Thread Joseph Rushton Wakeling
Thanks to all for the useful suggestions here. I'll have a play with the ideas suggested and come back if problems arise ... :-)

Re: log2 buggy or is a real thing?

2012-04-04 Thread bearophile
Jonathan M Davis: This progam: import std.math; import std.stdio; import std.typetuple; ulong log2(ulong n) { return n == 1 ? 0 : 1 + log2(n / 2); } void print(ulong value) { writefln(%s: %s %s, value, log2(value), std.math.log2(value)); } void

Re: log2 buggy or is a real thing?

2012-04-04 Thread bearophile
Do you know why is this program: import std.stdio; void main() { real r = 9223372036854775808UL; writefln(%1.19f, r); } Printing: 9223372036854775807.800 Instead of this? 9223372036854775808.000 Bye, bearophile

Re: Questions about the slice operator

2012-04-04 Thread Simen Kjærås
On Wed, 04 Apr 2012 12:06:33 +0200, Jacob Carlborg d...@me.com wrote: On 2012-04-04 04:11, Jonathan M Davis wrote: foreach(i; 0 .. 5) is more efficient only because it has _nothing_ to do with arrays. Generalizing the syntax wouldn't help at all, and if it were generalized, it would

Re: Questions about the slice operator

2012-04-04 Thread Jacob Carlborg
On 2012-04-04 14:16, Simen Kjærås wrote: And what do we do with 3..$? Hmm, that's a good point. The best I can think of for now is to translate that to: range(3, size_t.max) Or something like: struct range { size_t start; size_t end; bool dollar; // better name is needed }

Re: Questions about the slice operator

2012-04-04 Thread Simen Kjærås
On Wed, 04 Apr 2012 14:21:01 +0200, Jacob Carlborg d...@me.com wrote: On 2012-04-04 14:16, Simen Kjærås wrote: And what do we do with 3..$? Hmm, that's a good point. The best I can think of for now is to translate that to: range(3, size_t.max) Or something like: struct range {

Re: Questions about the slice operator

2012-04-04 Thread Simen Kjærås
On Wed, 04 Apr 2012 14:16:54 +0200, Simen Kjærås simen.kja...@gmail.com wrote: On Wed, 04 Apr 2012 12:06:33 +0200, Jacob Carlborg d...@me.com wrote: On 2012-04-04 04:11, Jonathan M Davis wrote: foreach(i; 0 .. 5) is more efficient only because it has _nothing_ to do with arrays.

Re: HelloWordl in Webserver

2012-04-04 Thread Adam D. Ruppe
On Wednesday, 4 April 2012 at 08:04:14 UTC, Xan wrote: Not, I receive the error: What version of D is that? lastSocketError is in phobos: http://dlang.org/phobos/std_socket.html#lastSocketError and it should work in windows and linux. Maybe your compiler is old.

Re: HelloWordl in Webserver

2012-04-04 Thread Dmitry Olshansky
Not, I receive the error: $ gdmd-4.6 server.d cgi.d -version=embedded_httpd std.algorithm.indexOf has been scheduled for deprecation. You may want to use std.algorithm.countUntil instead. Oh my, indexOf was deprecated? News to me. cgi.d:2231: Error: undefined identifier lastSocketError

Re: Questions about the slice operator

2012-04-04 Thread Simen Kjærås
On Wed, 04 Apr 2012 15:29:58 +0200, Jacob Carlborg d...@me.com wrote: On 2012-04-04 15:01, Simen Kjærås wrote: Actually, I've thought a little about this. And apart from the tiny idiosyncrasy of $, a..b as a more regular type can bring some interesting enhancements to the language. Consider

Re: Read a unicode character from the terminal

2012-04-04 Thread Jacob Carlborg
On 2012-03-31 17:56, Jacob Carlborg wrote: How would I read a unicode character from the terminal? I've tried using std.cstream.din.getc but it seems to only work for ascii characters. If I try to read and print something that isn't ascii, it just prints a question mark. I solved it like this:

Re: Questions about the slice operator

2012-04-04 Thread Jacob Carlborg
On 2012-04-04 16:40, Simen Kjærås wrote: It's quite simple, really - an index set holds indices. For a regular array of N elements, the index set it [0..N-1]. For an AA, the index set is all the keys in the AA. Basically, an index set is the set of all values that will give meaningful results

Re: log2 buggy or is a real thing?

2012-04-04 Thread Don Clugston
On 04/04/12 13:40, bearophile wrote: Jonathan M Davis: This progam: import std.math; import std.stdio; import std.typetuple; ulong log2(ulong n) { return n == 1 ? 0 : 1 + log2(n / 2); } void print(ulong value) { writefln(%s: %s %s, value, log2(value),

Re: Read a unicode character from the terminal

2012-04-04 Thread Stewart Gordon
On 31/03/2012 23:14, Stewart Gordon wrote: snip You might want to try the console module in my utility library: http://pr.stewartsplace.org.uk/d/sutil/ (For D1 at the moment, but a D2 version will be available any day now!) The D2 version is now up on the site. Jacob - would you be up for

Re: Read a unicode character from the terminal

2012-04-04 Thread Jacob Carlborg
On 2012-04-04 18:06, Stewart Gordon wrote: The D2 version is now up on the site. Jacob - would you be up for helping me with testing/implementation of my library on Mac OS? If you do a search for todo you'll see what needs to be done. Some of it will benefit Unix-type systems generally. If

Re: log2 buggy or is a real thing?

2012-04-04 Thread Timon Gehr
On 04/04/2012 05:15 PM, Don Clugston wrote: I don't think so. For 80-bit reals, every long can be represented exactly in an 80 bit real, as can every ulong from 0 up to and including ulong.max - 1. The only non-representable built-in integer is ulong.max, which (depending on rounding mode) gets

Re: Questions about the slice operator

2012-04-04 Thread Jonathan M Davis
On Wednesday, April 04, 2012 12:06:33 Jacob Carlborg wrote: On 2012-04-04 04:11, Jonathan M Davis wrote: foreach(i; 0 .. 5) is more efficient only because it has _nothing_ to do with arrays. Generalizing the syntax wouldn't help at all, and if it were generalized, it would arguably

Re: Questions about the slice operator

2012-04-04 Thread Jonathan M Davis
On Wednesday, April 04, 2012 14:37:54 Simen Kjærås wrote: On Wed, 04 Apr 2012 14:21:01 +0200, Jacob Carlborg d...@me.com wrote: On 2012-04-04 14:16, Simen Kjærås wrote: And what do we do with 3..$? Hmm, that's a good point. The best I can think of for now is to translate that to:

Re: log2 buggy or is a real thing?

2012-04-04 Thread Timon Gehr
On 04/04/2012 01:46 PM, bearophile wrote: Do you know why is this program: import std.stdio; void main() { real r = 9223372036854775808UL; writefln(%1.19f, r); } Printing: 9223372036854775807.800 Instead of this? 9223372036854775808.000 Bye,

Re: log2 buggy or is a real thing?

2012-04-04 Thread Don Clugston
On 04/04/12 18:53, Timon Gehr wrote: On 04/04/2012 05:15 PM, Don Clugston wrote: I don't think so. For 80-bit reals, every long can be represented exactly in an 80 bit real, as can every ulong from 0 up to and including ulong.max - 1. The only non-representable built-in integer is ulong.max,

Re: log2 buggy or is a real thing?

2012-04-04 Thread Don Clugston
On 04/04/12 13:46, bearophile wrote: Do you know why is this program: import std.stdio; void main() { real r = 9223372036854775808UL; writefln(%1.19f, r); } Printing: 9223372036854775807.800 Instead of this? 9223372036854775808.000 Bye, bearophile

Insert an element into an Associative Array ?

2012-04-04 Thread Chris Pons
I'm playing around with associative arrays right now and I can't seem to figure out how to add additional objects to the array. I tried insert but it doesn't recognize both arguments. Also, if I do this it produces an error: Node[bool] test; Node node; Node[bool] temp = [ false:node ]; test

Re: Insert an element into an Associative Array ?

2012-04-04 Thread H. S. Teoh
On Wed, Apr 04, 2012 at 08:57:54PM +0200, Chris Pons wrote: I'm playing around with associative arrays right now and I can't seem to figure out how to add additional objects to the array. I tried insert but it doesn't recognize both arguments. Also, if I do this it produces an error:

Re: Questions about the slice operator

2012-04-04 Thread Jacob Carlborg
On 2012-04-04 19:09, Jonathan M Davis wrote: That might work, but it does make it so that .. has very different meanings in different contexts, and I don't know that it really buys us much. iota already does them same thing (and with more functionality), just without the syntactic sugar. Also,

Re: Insert an element into an Associative Array ?

2012-04-04 Thread Jacob Carlborg
On 2012-04-04 20:57, Chris Pons wrote: I'm playing around with associative arrays right now and I can't seem to figure out how to add additional objects to the array. I tried insert but it doesn't recognize both arguments. Also, if I do this it produces an error: Node[bool] test; Node node;

Re: parallel unzip in progress

2012-04-04 Thread Jay Norwood
On Wednesday, 4 April 2012 at 07:39:56 UTC, Jay Norwood wrote: On Wednesday, 4 April 2012 at 07:25:25 UTC, dennis luehring I decided to try the option where the data is stored in the zip file uncompressed. Since the folder is just over 2GB, I ran into the stdio File problems with being

Re: Insert an element into an Associative Array ?

2012-04-04 Thread ixid
You're trying to append to something that's not an array, you haven't set the value part to be an array so you're doing doing the same as: int a; a ~= 5; which obviously doesn't work. If you want to append to an associative array create it like this: Node[][bool] test; //Conceptually maybe

Re: Insert an element into an Associative Array ?

2012-04-04 Thread ixid
Oops, the comment should read as follows, and test[bool] should not be on the next line. //Conceptually maybe clearer as Node[] test[bool]

Re: Insert an element into an Associative Array ?

2012-04-04 Thread Chris Pons
Ok, thanks for the help, much appreciated. On Wednesday, 4 April 2012 at 19:57:40 UTC, ixid wrote: Oops, the comment should read as follows, and test[bool] should not be on the next line. //Conceptually maybe clearer as Node[] test[bool]

Re: Read a unicode character from the terminal

2012-04-04 Thread Stewart Gordon
On 04/04/2012 17:37, Jacob Carlborg wrote: snip Sure I can help you with testing. I have a lot on my own table so I don't have any time for implementing things (maybe some small things). If I may ask, what is the point of this library? Just to hold some miscellaneous utility

Binary Heap Errors Class level vs function level

2012-04-04 Thread Chris Pons
I'm still messing around with binary heaps. I've successfully created and used it on the function level but for some reason when I move it to the class level I get an error. Furthermore, i'm not entirely sure how to use a binary heap without auto as the type. class AStar { ReferenceNode[]

Re: Binary Heap Errors Class level vs function level

2012-04-04 Thread Ali Çehreli
On 04/04/2012 05:24 PM, Chris Pons wrote: I'm still messing around with binary heaps. I've successfully created and used it on the function level but for some reason when I move it to the class level I get an error. Furthermore, i'm not entirely sure how to use a binary heap without auto as

[Issue 7818] __traits(allMembers) issue?

2012-04-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7818 --- Comment #2 from Manu turkey...@gmail.com 2012-04-04 00:35:41 PDT --- DMD32 D Compiler v2.058 ...only one version difference. It would seem so. There's no binaries for 059 yet. How often do they usually get built? -- Configure issuemail:

[Issue 7818] __traits(allMembers) issue?

2012-04-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7818 --- Comment #3 from Kenji Hara k.hara...@gmail.com 2012-04-04 01:18:07 PDT --- (In reply to comment #2) DMD32 D Compiler v2.058 ...only one version difference. It would seem so. I think this issue is much similar with bug 7160, but it was

[Issue 7493] Initialization of void[][N]

2012-04-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7493 --- Comment #7 from Don clugd...@yahoo.com.au 2012-04-04 02:56:24 PDT --- https://github.com/D-Programming-Language/dmd/pull/866 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail

[Issue 7819] New: std.file.setTimes throws error on folders

2012-04-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7819 Summary: std.file.setTimes throws error on folders Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Severity: normal Priority: P2

[Issue 7802] UFCS functions get lost when type is transmitted to template

2012-04-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7802 Steven Schveighoffer schvei...@yahoo.com changed: What|Removed |Added CC|

[Issue 7820] New: regression(DMD 2.059head) Wrong error on forward reference to 'front' with -property switch

2012-04-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7820 Summary: regression(DMD 2.059head) Wrong error on forward reference to 'front' with -property switch Product: D Version: unspecified Platform: All OS/Version: All

  1   2   >