Re: Partial classes

2012-06-25 Thread Max Samukha
On Monday, 25 June 2012 at 23:44:09 UTC, Walter Bright wrote: As Timon also said, in C# you have to add in "partial" to the class definition anyway - isn't that the same as inserting a template/string/import mixin or pimpl? That is not exactly the same. The important difference is that par

Re: Get rid of isInfinite()?

2012-06-25 Thread Mehrdad
On Tuesday, 26 June 2012 at 06:05:49 UTC, Jonathan M Davis wrote: If you can't calculate the length in O(1), then you're stuck using walkLength, which means iterating over the entire range to get its length. And if that's the case, then you can't make it a random access range, because for it to

Re: Narrow Windows Borders with SDL and D

2012-06-25 Thread Roman D. Boiko
On Tuesday, 26 June 2012 at 02:02:05 UTC, Kapps wrote: I can't find the post that I'm thinking of, but I remember this being discussed before. Essentially, it's something with Optlink that you can disable that makes Windows think it should use outdated styles. Did you mean this question: htt

Re: Get rid of isInfinite()?

2012-06-25 Thread Roman D. Boiko
On Tuesday, 26 June 2012 at 03:40:11 UTC, Mehrdad wrote: On Monday, 25 June 2012 at 23:03:59 UTC, Jonathan M Davis wrote: If you can somehow figure out how to do that via buffering, then you could make it a forward range as well as whatever other range types you could define the functions for,

Re: Get rid of isInfinite()?

2012-06-25 Thread Jonathan M Davis
On Tuesday, June 26, 2012 05:40:10 Mehrdad wrote: > On Monday, 25 June 2012 at 23:03:59 UTC, Jonathan M Davis wrote: > > You could store those elements internally as you iterate over > > them > > That's *precisely* the point of my wrapper... sorry if that > wasn't clear. > > Why shouldn't that be

Re: Is this statement in http://dlang.org/dmd-windows.html still true?

2012-06-25 Thread Jesse Phillips
On Tuesday, 26 June 2012 at 03:44:17 UTC, Mehrdad wrote: On Tuesday, 26 June 2012 at 03:02:45 UTC, Jesse Phillips wrote: Linux places string literals in Read-Only Memory, Windows does not. This is OS specific behavior and does not relate to the language in the least. Isn't it compiler-specifi

Re: Is this statement in http://dlang.org/dmd-windows.html still true?

2012-06-25 Thread Mehrdad
On Tuesday, 26 June 2012 at 03:02:45 UTC, Jesse Phillips wrote: Linux places string literals in Read-Only Memory, Windows does not. This is OS specific behavior and does not relate to the language in the least. Isn't it compiler-specific behavior? Visual C++ does this on Windows. After all, it

Re: How to break const

2012-06-25 Thread Mehrdad
On Monday, 25 June 2012 at 17:33:18 UTC, Timon Gehr wrote: On 06/25/2012 04:08 PM, Steven Schveighoffer wrote: Last time I asked, Walter made clear that such a change is not planned. Assuming that's still true today, do we have a proposal for fixing this? (If not, then is it safe to say th

Re: Get rid of isInfinite()?

2012-06-25 Thread Mehrdad
On Monday, 25 June 2012 at 23:03:59 UTC, Jonathan M Davis wrote: You could store those elements internally as you iterate over them That's *precisely* the point of my wrapper... sorry if that wasn't clear. Why shouldn't that be sufficient for making it random-access? If you can someh

Re: dlang.org live examples

2012-06-25 Thread Jesse Phillips
On Monday, 25 June 2012 at 21:26:01 UTC, David Nadlinger wrote: On Monday, 25 June 2012 at 20:34:39 UTC, Jesse Phillips wrote: FYI: Someone somewhere has that up on their demo site. Don't know why it hasn't been activated. You mean Adam Ruppe's take on executable code snippets? David Yeah,

Re: range.size() should be long, right?

2012-06-25 Thread Mehrdad
On Tuesday, 26 June 2012 at 00:31:01 UTC, Alex Rønne Petersen wrote: IMHO unsigned is fine. I personally strongly dislike the .NET situation where the convention is to use signed ints for everything due to some stupid language interoperability guideline just for VB.NET (and J# previously). Ye

Re: Is this statement in http://dlang.org/dmd-windows.html still true?

2012-06-25 Thread Jesse Phillips
On Tuesday, 26 June 2012 at 00:56:48 UTC, Pierre Rouleau wrote: "String literals are read-only under Linux. Attempting to write to them will cause a segment violation." You have read this completely wrong. It is still true today. Linux places string literals in Read-Only Memory, Windows does

Re: range.size() should be long, right?

2012-06-25 Thread Walter Bright
On 6/25/2012 11:24 AM, Jonathan M Davis wrote: It depends entirely on the range. Exactly. The definition of a range that has a 'length' property is that it returns type 'auto'.

Re: Is this statement in http://dlang.org/dmd-windows.html still true?

2012-06-25 Thread Pierre Rouleau
On 12-06-25 9:06 PM, Bernard Helyer wrote: That being said, it does no harm (i.e. it isn't _wrong_). Understood, but it might be a good thing to qualify it. I am looking at D again (D2.0) and would like to start pushing it for my group at work. Unqualified statements like this might scare a

Re: Narrow Windows Borders with SDL and D

2012-06-25 Thread Kapps
On Monday, 25 June 2012 at 18:08:09 UTC, Bernard Helyer wrote: Perhaps someone more Windows savvy than I can figure this mystery out. When creating windows through SDL via D, the windows created -- when viewed with Windows Classic, Aero Basic, or Luna (on XP) -- have minimal border padding, lik

Re: Partial classes

2012-06-25 Thread Kapps
Any reason that just using mixin(import("myclass.partial.d")) wouldn't work?

Re: Is this statement in http://dlang.org/dmd-windows.html still true?

2012-06-25 Thread Bernard Helyer
It's out of date. Or is this statement there to want you not take the address of a string literal and attempt to write it via a pointer? Even then you have to actively try and break the type system auto p = cast(char*) "foo".ptr; And if you remove the brakes from your car, you shouldn't

Re: Is this statement in http://dlang.org/dmd-windows.html still true?

2012-06-25 Thread Bernard Helyer
That being said, it does no harm (i.e. it isn't _wrong_).

Is this statement in http://dlang.org/dmd-windows.html still true?

2012-06-25 Thread Pierre Rouleau
Hi all, inside http://dlang.org/dmd-windows.html#environment down in the section titled Differences between Windows and Linux versions, the statement is: "String literals are read-only under Linux. Attempting to write to them will cause a segment violation." This looks like an old and obsol

Re: range.size() should be long, right?

2012-06-25 Thread Alex Rønne Petersen
On 25-06-2012 20:28, Mehrdad wrote: On Monday, 25 June 2012 at 18:22:00 UTC, Artur Skawina wrote: What makes you think 'length' should evaluate to a size_t? If it it's documented like that somewhere then that should be fixed. That is a VERY good question... I guess it doesn't /have/ to... did

Re: Partial classes

2012-06-25 Thread Walter Bright
On 6/25/2012 2:26 PM, Manu wrote: On 25 June 2012 23:30, Walter Bright Adding behavior into an existing class that was not designed for it is, to me, like Ruby's "monkey-patching", since you could look at a class definition and have no clue if members were added by arbitrary other code or not

Re: Get rid of isInfinite()?

2012-06-25 Thread Jonathan M Davis
On Tuesday, June 26, 2012 00:46:40 Mehrdad wrote: > On Monday, 25 June 2012 at 18:29:45 UTC, Bernard Helyer wrote: > > On Monday, 25 June 2012 at 17:43:01 UTC, Mehrdad wrote: > >> In that case, how do you make a random-access wrapper around > >> an input range? > > > > You don't. If you could, the

Re: Get rid of isInfinite()?

2012-06-25 Thread Mehrdad
On Monday, 25 June 2012 at 18:29:45 UTC, Bernard Helyer wrote: On Monday, 25 June 2012 at 17:43:01 UTC, Mehrdad wrote: In that case, how do you make a random-access wrapper around an input range? You don't. If you could, they wouldn't be an input range. Wait, what? I don't see why you _sho

Re: Partial classes

2012-06-25 Thread Timon Gehr
On 06/25/2012 11:26 PM, Manu wrote: On 25 June 2012 23:30, Walter Bright mailto:newshou...@digitalmars.com>> wrote: On 6/25/2012 8:26 AM, Manu wrote: I suspect this isn't possible in a compiled language like D, but I wonder anyway, has anyone considered partial class

Re: AST files instead of DI interface files for faster compilation and easier distribution

2012-06-25 Thread Martin Nowak
On Mon, 18 Jun 2012 19:53:43 +0200, Walter Bright wrote: On 6/18/2012 6:07 AM, Don Clugston wrote: On 17/06/12 00:37, Walter Bright wrote: On 6/14/2012 1:03 AM, Don Clugston wrote: It is for debug builds. Iain's data indicates that it's only a few % of the time taken on semantic1(). Do yo

Re: D runtime in os x dylib

2012-06-25 Thread Martin Nowak
On Mon, 25 Jun 2012 14:17:01 +0200, Jacob Carlborg wrote: On 2012-06-24 16:39, John Colvin wrote: Hmm, nothing in the last 3 months. Looks like i may have to abandon os x for development at least for the near future. I'm not entirely sure but maybe you're having this problem: http://d.purem

Re: dlang.org live examples

2012-06-25 Thread David Nadlinger
On Monday, 25 June 2012 at 20:34:39 UTC, Jesse Phillips wrote: FYI: Someone somewhere has that up on their demo site. Don't know why it hasn't been activated. You mean Adam Ruppe's take on executable code snippets? David

Re: Partial classes

2012-06-25 Thread Manu
On 25 June 2012 23:30, Walter Bright wrote: > On 6/25/2012 8:26 AM, Manu wrote: > >> I suspect this isn't possible in a compiled language like D, but I wonder >> anyway, has anyone considered partial classes in D? Are they technically >> possible? >> How would they work? Would it depend on link-t

Re: Partial classes

2012-06-25 Thread Max Samukha
On Monday, 25 June 2012 at 20:31:18 UTC, Walter Bright wrote: On 6/25/2012 8:26 AM, Manu wrote: I suspect this isn't possible in a compiled language like D, but I wonder anyway, has anyone considered partial classes in D? Are they technically possible? How would they work? Would it depend on li

Re: dlang.org live examples

2012-06-25 Thread Jesse Phillips
On Monday, 25 June 2012 at 14:43:34 UTC, nazriel wrote: Hi! I am polishing up this stuff: http://dlang.dzfl.pl/ I would love to hear your opinion on those. Best regards, Damian 'nazriel' Ziemba FYI: Someone somewhere has that up on their demo site. Don't know why it hasn't been activated.

Re: dlang.org live examples

2012-06-25 Thread nazriel
On Monday, 25 June 2012 at 19:27:13 UTC, mta`chrono wrote: Hey, that's quite cool what you did! how did you do that? do you use fastcgi or cgi? how do you execute your code? inside some chroot environment or some other kind of virtual maschine. mta`chrono When you click Run button on dlang

Re: Partial classes

2012-06-25 Thread Walter Bright
On 6/25/2012 8:26 AM, Manu wrote: I suspect this isn't possible in a compiled language like D, but I wonder anyway, has anyone considered partial classes in D? Are they technically possible? How would they work? Would it depend on link-time code generation? I can imagine an implementation where

Re: dlang.org live examples

2012-06-25 Thread nazriel
On Monday, 25 June 2012 at 19:27:13 UTC, mta`chrono wrote: Hey, that's quite cool what you did! how did you do that? do you use fastcgi or cgi? how do you execute your code? inside some chroot environment or some other kind of virtual maschine. mta`chrono When you click Run button on dlang

Re: GWAN webserver allowing dynamic pages in D

2012-06-25 Thread Dmitry Olshansky
On 25-Jun-12 14:17, P. Lefevre wrote: For those interested in web development, GWAN is a VERY fast web server (Linux only) which allow development of dynamic pages in C, C++, Objective-C, Objective-C++, and D (since january this year) ! see http://gwan.ch/ NB: the perf benchmark on this site se

Re: dlang.org live examples

2012-06-25 Thread Robik
On Monday, 25 June 2012 at 14:43:34 UTC, nazriel wrote: Hi! I am polishing up this stuff: http://dlang.dzfl.pl/ It would allow to run examples from http://dlang.org directly in web-browser. Something like http://dpaste.dzfl.pl, but integrated with dlang website itself. I would like to ask y

Re: dlang.org live examples

2012-06-25 Thread mta`chrono
Hey, that's quite cool what you did! how did you do that? do you use fastcgi or cgi? how do you execute your code? inside some chroot environment or some other kind of virtual maschine. mta`chrono

Re: dlang.org live examples

2012-06-25 Thread Kevin
On Mon 25 Jun 2012 12:46:27 EDT, David Gileadi wrote: > On 6/25/12 7:43 AM, nazriel wrote: >> First, should standard input and command line arguments be constant >> defined in hidden html fields, or should we allow user to pick their >> own? >> It would allow for more freedom and experience but on

Re: D runtime in os x dylib

2012-06-25 Thread Jacob Carlborg
On 2012-06-25 18:26, John Colvin wrote: On Monday, 25 June 2012 at 12:17:03 UTC, Jacob Carlborg wrote: On 2012-06-24 16:39, John Colvin wrote: Hmm, nothing in the last 3 months. Looks like i may have to abandon os x for development at least for the near future. I'm not entirely sure but maybe

Re: range.size() should be long, right?

2012-06-25 Thread Timon Gehr
On 06/25/2012 07:49 PM, Mehrdad wrote: Shouldn't the length of a range should be a long? Otherwise there's no way we could possibly replace streams with ranges. 32-bit systems have LOTS of common streams that are over 2^32 bytes (e.g. DVD images, partition images, large movies, etc.). And not j

Re: GWAN webserver allowing dynamic pages in D

2012-06-25 Thread Bernard Helyer
On Monday, 25 June 2012 at 10:17:27 UTC, P. Lefevre wrote: For those interested in web development, GWAN is a VERY fast web server (Linux only) which allow development of dynamic pages in C, C++, Objective-C, Objective-C++, and D (since january this year) ! see http://gwan.ch/ NB: the perf b

Re: range.size() should be long, right?

2012-06-25 Thread Mehrdad
On Monday, 25 June 2012 at 18:22:00 UTC, Artur Skawina wrote: What makes you think 'length' should evaluate to a size_t? If it it's documented like that somewhere then that should be fixed. That is a VERY good question... I guess it doesn't /have/ to... didn't quite realize this. But the fac

Re: Get rid of isInfinite()?

2012-06-25 Thread Bernard Helyer
On Monday, 25 June 2012 at 17:43:01 UTC, Mehrdad wrote: In that case, how do you make a random-access wrapper around an input range? You don't. If you could, they wouldn't be an input range.

Re: GWAN webserver allowing dynamic pages in D

2012-06-25 Thread Timon Gehr
On 06/25/2012 03:42 PM, Andrea Fontana wrote: Using C plain api it's not a good way to use D power IMHO :) xbuf_ncat(get_reply(argv), "Hello World (D)", "Hello World (C)".sizeof - 1); Probably this example doesn't work properly. On my machine writeln("1234".sizeof); gives "16" because of UTF-8.

Re: Get rid of isInfinite()?

2012-06-25 Thread Jonathan M Davis
On Monday, June 25, 2012 19:43:00 Mehrdad wrote: > On Monday, 25 June 2012 at 17:38:55 UTC, Steven Schveighoffer > > wrote: > > I think you misunderstand an infinite range. There are plenty > > of truly infinite ranges available. > > > > An example infinite range: > > > > struct Infinite > > { >

Re: range.size() should be long, right?

2012-06-25 Thread Jonathan M Davis
On Monday, June 25, 2012 19:49:54 Mehrdad wrote: > Shouldn't the length of a range should be a long? > > Otherwise there's no way we could possibly replace streams with > ranges. > 32-bit systems have LOTS of common streams that are over 2^32 > bytes (e.g. DVD images, partition images, large movie

Re: range.size() should be long, right?

2012-06-25 Thread Jonathan M Davis
On Monday, June 25, 2012 19:49:54 Mehrdad wrote: > Shouldn't the length of a range should be a long? > > Otherwise there's no way we could possibly replace streams with > ranges. > 32-bit systems have LOTS of common streams that are over 2^32 > bytes (e.g. DVD images, partition images, large movie

Re: range.size() should be long, right?

2012-06-25 Thread Artur Skawina
On 06/25/12 19:49, Mehrdad wrote: > Shouldn't the length of a range should be a long? > > Otherwise there's no way we could possibly replace streams with ranges. > 32-bit systems have LOTS of common streams that are over 2^32 bytes (e.g. DVD > images, partition images, large movies, etc.). > > A

Re: Narrow Windows Borders with SDL and D

2012-06-25 Thread Johannes Pfau
Am Mon, 25 Jun 2012 20:08:08 +0200 schrieb "Bernard Helyer" : > Perhaps someone more Windows savvy than I can figure this mystery > out. When creating windows through SDL via D, the windows created > -- when viewed with Windows Classic, Aero Basic, or Luna (on XP) > -- have minimal border paddi

Re: Narrow Windows Borders with SDL and D

2012-06-25 Thread Bernard Helyer
Looks like one of the styles ( http://msdn.microsoft.com/en-us/library/windows/desktop/ms632600(v=vs.85).aspx ) is being set or not set. WS_THICKFRAME or WS_BORDER look like likely candidates.

Narrow Windows Borders with SDL and D

2012-06-25 Thread Bernard Helyer
Perhaps someone more Windows savvy than I can figure this mystery out. When creating windows through SDL via D, the windows created -- when viewed with Windows Classic, Aero Basic, or Luna (on XP) -- have minimal border padding, like so: http://i.imgur.com/48atZ.png (basic) http://i.imgur.com/

Re: New hash API: namespace

2012-06-25 Thread Jesse Phillips
On Monday, 25 June 2012 at 16:09:43 UTC, Felix Hufnagel wrote: +1 for hashes into std.hash and cryptographic primitives into std.crypto and we should have a std.net (std.uri, std.socket, std.socketstream , std.net.curl, ...), std.io. for (Outbuffer, file, ) and probably std.database or som

Re: Get rid of isInfinite()?

2012-06-25 Thread Mehrdad
On Monday, 25 June 2012 at 17:28:27 UTC, Mehrdad wrote: On Monday, 25 June 2012 at 17:26:23 UTC, Mehrdad wrote: I feel like isInfinite is useless for typical cases... the only "infinite" (perhaps I should call it "unbounded" instead?) range I've ever realistically come across is a stream, like

range.size() should be long, right?

2012-06-25 Thread Mehrdad
Shouldn't the length of a range should be a long? Otherwise there's no way we could possibly replace streams with ranges. 32-bit systems have LOTS of common streams that are over 2^32 bytes (e.g. DVD images, partition images, large movies, etc.). And not just that -- if we use size_t instead

Re: Get rid of isInfinite()?

2012-06-25 Thread Mehrdad
On Monday, 25 June 2012 at 17:38:55 UTC, Steven Schveighoffer wrote: I think you misunderstand an infinite range. There are plenty of truly infinite ranges available. An example infinite range: struct Infinite { int x; @property int front() { return x;} void popFront() {} enum e

Re: Get rid of isInfinite()?

2012-06-25 Thread Timon Gehr
On 06/25/2012 07:26 PM, Mehrdad wrote: I feel like isInfinite is useless for typical cases... the only "infinite" (perhaps I should call it "unbounded" instead?) range I've ever realistically come across is a stream, like console input or a network stream. Console input or network streams can

Re: Get rid of isInfinite()?

2012-06-25 Thread Steven Schveighoffer
On Mon, 25 Jun 2012 13:26:22 -0400, Mehrdad wrote: I feel like isInfinite is useless for typical cases... the only "infinite" (perhaps I should call it "unbounded" instead?) range I've ever realistically come across is a stream, like console input or a network stream. Of course, isInfini

Re: How to break const

2012-06-25 Thread Timon Gehr
On 06/25/2012 04:08 PM, Steven Schveighoffer wrote: ... This is quite a long thread, and I didn't read everything, but here is my take on this: 1. The issue is that the context pointer of the delegate, even though it is stored as part of the struct data, is not affected by coloring the containi

Re: Get rid of isInfinite()?

2012-06-25 Thread Mehrdad
On Monday, 25 June 2012 at 17:26:23 UTC, Mehrdad wrote: I feel like isInfinite is useless for typical cases... the only "infinite" (perhaps I should call it "unbounded" instead?) range I've ever realistically come across is a stream, like console input or a network stream. Of course, isInfini

Get rid of isInfinite()?

2012-06-25 Thread Mehrdad
I feel like isInfinite is useless for typical cases... the only "infinite" (perhaps I should call it "unbounded" instead?) range I've ever realistically come across is a stream, like console input or a network stream. Of course, isInfinite doesn't make any sense for any type of wrapper around

Re: Partial classes

2012-06-25 Thread Timon Gehr
On 06/25/2012 05:26 PM, Manu wrote: I suspect this isn't possible in a compiled language like D, but I wonder anyway, has anyone considered partial classes in D? Are they technically possible? How would they work? Would it depend on link-time code generation? Ideally yes, but it should be possi

Re: dlang.org live examples

2012-06-25 Thread David Gileadi
On 6/25/12 7:43 AM, nazriel wrote: First, should standard input and command line arguments be constant defined in hidden html fields, or should we allow user to pick their own? It would allow for more freedom and experience but on other-hand it would bloat too much website. Whats your opinion?

Re: D runtime in os x dylib

2012-06-25 Thread John Colvin
On Monday, 25 June 2012 at 12:17:03 UTC, Jacob Carlborg wrote: On 2012-06-24 16:39, John Colvin wrote: Hmm, nothing in the last 3 months. Looks like i may have to abandon os x for development at least for the near future. I'm not entirely sure but maybe you're having this problem: http://d.p

Re: New hash API: namespace

2012-06-25 Thread Dmitry Olshansky
On 25-Jun-12 20:09, Felix Hufnagel wrote: +1 for hashes into std.hash and cryptographic primitives into std.crypto Another +1 here and we should have std.net (std.uri, std.socket, std.socketstream , std.net.curl, ...), std.io for proper I/O framework. and probably std.data or something like t

Re: New hash API: namespace

2012-06-25 Thread nazriel
On Monday, 25 June 2012 at 16:09:43 UTC, Felix Hufnagel wrote: +1 for hashes into std.hash and cryptographic primitives into std.crypto and we should have a std.net (std.uri, std.socket, std.socketstream , std.net.curl, ...), std.io. for (Outbuffer, file, ) and probably std.database or som

Re: New hash API: namespace

2012-06-25 Thread Felix Hufnagel
+1 for hashes into std.hash and cryptographic primitives into std.crypto and we should have a std.net (std.uri, std.socket, std.socketstream , std.net.curl, ...), std.io. for (Outbuffer, file, ) and probably std.database or something like that for (csv, json, xml, ...) ... Am 25.06.2012

Re: Partial classes

2012-06-25 Thread Regan Heath
On Mon, 25 Jun 2012 16:26:27 +0100, Manu wrote: I suspect this isn't possible in a compiled language like D, but I wonder anyway, has anyone considered partial classes in D? Are they technically possible? How would they work? Would it depend on link-time code generation? I can imagine an implem

Re: An idea to avoid a narrow class of bugs

2012-06-25 Thread Jonathan M Davis
On Monday, June 25, 2012 15:22:03 Alex Rønne Petersen wrote: > > To me, it is a GC implementation issue. You should be able to allocate > > in destructors. > > Yes, I don't understand why on earth this limitation is in place. There > is no (good) technical reason it should be there. I believe tha

Re: GWAN webserver allowing dynamic pages in D

2012-06-25 Thread Eric R. Schulz (ers35)
See [1] for details on how to run your own benchmark. It would be interesting to compare Warp and G-WAN using both of their provided benchmark tests. [1]http://forum.gwan.com/index.php?p=/discussion/525/nginx1.0.6-vs-lighttpd1.4.29-vs-g-wan2.9.30-rpscpuram On Monday, 25 June 2012 at 15:09:58

Re: dlang.org live examples

2012-06-25 Thread nazriel
On Monday, 25 June 2012 at 15:03:20 UTC, Andrea Fontana wrote: Why don't you split horizontally? Left: source, Right input (not hidden!) + output. In code there's a typo: "souce" instead of "source" On Monday, 25 June 2012 at 14:43:34 UTC, nazriel wrote: Hi! I am polishing up this stuff: htt

Re: dlang.org live examples

2012-06-25 Thread nazriel
On Monday, 25 June 2012 at 14:59:35 UTC, Kevin wrote: On 25/06/12 10:43, nazriel wrote: Hi! I am polishing up this stuff: http://dlang.dzfl.pl/ It would allow to run examples from http://dlang.org directly in web-browser. Something like http://dpaste.dzfl.pl, but integrated with dlang websit

Re: New hash API: namespace

2012-06-25 Thread Jonathan M Davis
On Monday, June 25, 2012 12:24:44 Piotr Szturmaj wrote: > Jonathan M Davis wrote: > > On Monday, June 25, 2012 11:35:33 Johannes Pfau wrote: > >> OK, so I understand std.util is probably not a good idea. > >> > >> So the candidates for the namespace are: > >> * std.crypto.hash > >> * std.checksum

Partial classes

2012-06-25 Thread Manu
I suspect this isn't possible in a compiled language like D, but I wonder anyway, has anyone considered partial classes in D? Are they technically possible? How would they work? Would it depend on link-time code generation? I can imagine an implementation where each 'part' occupies a separate alloc

Re: GWAN webserver allowing dynamic pages in D

2012-06-25 Thread Caligo
I don't know much about web servers, but is it really the only web server "able to scale on multi-core CPUs"?? I've played around with Yesod/Warp and I was under the impression that it's one of the fastest. http://www.yesodweb.com/blog/2011/03/preliminary-warp-cross-language-benchmarks On Mon,

Re: dlang.org live examples

2012-06-25 Thread Andrea Fontana
Why don't you split horizontally? Left: source, Right input (not hidden!) + output. In code there's a typo: "souce" instead of "source" On Monday, 25 June 2012 at 14:43:34 UTC, nazriel wrote: Hi! I am polishing up this stuff: http://dlang.dzfl.pl/ It would allow to run examples from http://d

Re: dlang.org live examples

2012-06-25 Thread Kevin
On 25/06/12 10:43, nazriel wrote: > Hi! > > I am polishing up this stuff: > http://dlang.dzfl.pl/ > > It would allow to run examples from http://dlang.org directly in > web-browser. > Something like http://dpaste.dzfl.pl, but integrated with dlang > website itself. > > I would like to ask you about

dlang.org live examples

2012-06-25 Thread nazriel
Hi! I am polishing up this stuff: http://dlang.dzfl.pl/ It would allow to run examples from http://dlang.org directly in web-browser. Something like http://dpaste.dzfl.pl, but integrated with dlang website itself. I would like to ask you about your opinions and advises. There are couple thi

Re: An idea to avoid a narrow class of bugs

2012-06-25 Thread Christophe Travert
Alex Rønne Petersen , dans le message (digitalmars.D:170622), a écrit : > On 25-06-2012 15:27, Christophe Travert wrote: >> Alex Rønne Petersen , dans le message (digitalmars.D:170616), a écrit : To me, it is a GC implementation issue. You should be able to allocate in destructors. >

Re: How to break const

2012-06-25 Thread Steven Schveighoffer
On Mon, 18 Jun 2012 01:36:26 -0400, Mehrdad wrote: Is it just me, or did I subvert the type system here? import std.stdio; struct Const { this(void delegate() increment) { this.increment = increment; } int a; void delegate() increment; void oops() cons

Re: An idea to avoid a narrow class of bugs

2012-06-25 Thread Benjamin Thaut
The idea is nice, it would help newcomers a lot. But please also think about the people that are using D _without_ a garbage collector. I wouldn't want the compiler to complain about something that isn't even true with my modified version of druntime. Kind Regards Benjamin Thaut I've suggest

Re: GWAN webserver allowing dynamic pages in D

2012-06-25 Thread Eric R. Schulz (ers35)
True. I will investigate writing a D wrapper for the C API. Using C plain api it's not a good way to use D power IMHO :) Encapsulate code with classes/template/etc would be a good idea.

Re: LinkedList and Deque API in DCollections

2012-06-25 Thread Steven Schveighoffer
On Mon, 25 Jun 2012 09:44:12 -0400, Steven Schveighoffer wrote: No, if you want to use those asserts, build dcollections with debug flag. Should have said "without release flag", you don't need to build with debug flag. -Steve

Re: LinkedList and Deque API in DCollections

2012-06-25 Thread Steven Schveighoffer
On Thu, 21 Jun 2012 10:24:57 -0400, d coder wrote: Did you try : list.insert(list.begin, value); Thanks. But I believe append and prepend are too common use-cases to be ignored. Also, I see that "assert(some-expression)" has been used at a lot of places in the code of the libraries. Sin

Re: GWAN webserver allowing dynamic pages in D

2012-06-25 Thread Andrea Fontana
Using C plain api it's not a good way to use D power IMHO :) xbuf_ncat(get_reply(argv), "Hello World (D)", "Hello World (C)".sizeof - 1); Probably this example doesn't work properly. On my machine writeln("1234".sizeof); gives "16" because of UTF-8. So "1234".sizeof - 1 is 15. AFAIK D stri

Re: An idea to avoid a narrow class of bugs

2012-06-25 Thread Alex Rønne Petersen
On 25-06-2012 15:27, Christophe Travert wrote: Alex Rønne Petersen , dans le message (digitalmars.D:170616), a écrit : To me, it is a GC implementation issue. You should be able to allocate in destructors. Yes, I don't understand why on earth this limitation is in place. There is no (good) te

Re: LinkedList and Deque API in DCollections

2012-06-25 Thread Steven Schveighoffer
On Thu, 21 Jun 2012 08:53:33 -0400, d coder wrote: Greetings I do not know if this email belongs to this list or not. It is about a package available at dsource. Let me know if I should be posting such emails elsewhere. This list is fine, you can also create tickets for the TRAC instance for

Re: GWAN webserver allowing dynamic pages in D

2012-06-25 Thread Eric R. Schulz (ers35)
G-WAN exports a C API and D supports calling C functions. In what way could G-WAN better support D? Perhaps reading the G-WAN manual would help to explain: http://gwan.ch/archives/gwan_linux.pdf Maybe they should give a better support for D language...

Re: New hash API: namespace

2012-06-25 Thread Jacob Carlborg
On 2012-06-25 12:24, Piotr Szturmaj wrote: Jonathan M Davis wrote: On Monday, June 25, 2012 11:35:33 Johannes Pfau wrote: OK, so I understand std.util is probably not a good idea. So the candidates for the namespace are: * std.crypto.hash * std.checksum * std.crypto.hash and std.checksum * std

Re: equality operators on types

2012-06-25 Thread Timon Gehr
On 06/25/2012 02:40 PM, Steven Schveighoffer wrote: On Sat, 16 Jun 2012 01:19:49 -0400, Bernard Helyer wrote: On Friday, 15 June 2012 at 12:56:49 UTC, Timon Gehr wrote: On 06/15/2012 02:19 PM, bearophile wrote: Timon Gehr: Why not allow equality operators to operate on types? That's nice

Re: An idea to avoid a narrow class of bugs

2012-06-25 Thread Christophe Travert
Alex Rønne Petersen , dans le message (digitalmars.D:170616), a écrit : >> >> To me, it is a GC implementation issue. You should be able to allocate >> in destructors. > > Yes, I don't understand why on earth this limitation is in place. There > is no (good) technical reason it should be there.

Re: An idea to avoid a narrow class of bugs

2012-06-25 Thread deadalnix
Le 25/06/2012 13:35, bearophile a écrit : I've suggested to add a little piece of static analysis inside the D compiler, able to catch all cases of a specific kind of bugs: http://d.puremagic.com/issues/show_bug.cgi?id=8293 A short thread in D.learn about a core.exception.InvalidMemoryOperatio

Re: New hash API: Update

2012-06-25 Thread Alex Rønne Petersen
On 25-06-2012 11:13, Johannes Pfau wrote: Am Sun, 24 Jun 2012 17:58:47 -0700 schrieb Jonathan M Davis : On Sunday, June 24, 2012 17:23:18 Johannes Pfau wrote: I'm mostly finished with my hash API proposal. I also ported the existing crc, md5 and the proposed sha1 hash to this new API. I chang

Re: AST files instead of DI interface files for faster compilation and easier distribution

2012-06-25 Thread Steven Schveighoffer
On Mon, 18 Jun 2012 13:53:43 -0400, Walter Bright wrote: On 6/18/2012 6:07 AM, Don Clugston wrote: On 17/06/12 00:37, Walter Bright wrote: On 6/14/2012 1:03 AM, Don Clugston wrote: It is for debug builds. Iain's data indicates that it's only a few % of the time taken on semantic1(). Do yo

Re: "static" UFCS

2012-06-25 Thread Steven Schveighoffer
On Thu, 14 Jun 2012 02:46:13 -0400, Jacob Carlborg wrote: UFCS can be used to emulate adding new members/instance methods to a class or struct: class Foo { } void bar (Foo foo, int x) {} auto foo = new Foo; foo.bar(3); Is it possible, somehow, to emulate adding new _static_ methods to a

Re: std.hash design

2012-06-25 Thread Regan Heath
On Fri, 22 Jun 2012 18:34:10 +0100, Johannes Pfau wrote: Am Fri, 22 Jun 2012 18:12:20 +0100 schrieb "Regan Heath" : Agreed. In fact I wouldn't bother with finishString either TBH, people can always pass the result of finish string into the method which produces the hex string representat

Re: equality operators on types

2012-06-25 Thread Steven Schveighoffer
On Sat, 16 Jun 2012 01:19:49 -0400, Bernard Helyer wrote: On Friday, 15 June 2012 at 12:56:49 UTC, Timon Gehr wrote: On 06/15/2012 02:19 PM, bearophile wrote: Timon Gehr: Why not allow equality operators to operate on types? That's nice, of course. But is it possible? Yes, certainly.

Re: GWAN webserver allowing dynamic pages in D

2012-06-25 Thread Andrea Fontana
It's just an import of two extern(C) functions. I read: extern (C) // could anyone translate the whole gwan.h file? { void *get_reply(char[][]); char *xbuf_ncat(void *, char *, uint); } And then: xbuf_ncat(get_reply(argv), "Hello World (D)", "Hello World (C)".sizeof - 1); Maybe they sh

Re: D runtime in os x dylib

2012-06-25 Thread Jacob Carlborg
On 2012-06-24 16:39, John Colvin wrote: Hmm, nothing in the last 3 months. Looks like i may have to abandon os x for development at least for the near future. I'm not entirely sure but maybe you're having this problem: http://d.puremagic.com/issues/show_bug.cgi?id=7995 Pull the latest source

Re: An idea to avoid a narrow class of bugs

2012-06-25 Thread Rene Zwanenburg
I like this idea, I've had some nasty bugs because of this when I just started with D. But IIRC the language doesn't forbid use of the GC in destructors, meaning it's an implementation issue. I don't know what the problems involved in allowing allocations during sweeps are, but I'd prefer to

Re: return table from local resource

2012-06-25 Thread Timon Gehr
On 06/25/2012 01:11 PM, bearophile wrote: monarch_dodra: What bothers me is that it was my understanding that the D language standard protected me from this kind of undefined behavior. I did make use of anything unsafe, so what gives? Compiler not catch it but should have? Currently the compi

Re: return table from local resource

2012-06-25 Thread bearophile
monarch_dodra: What bothers me is that it was my understanding that the D language standard protected me from this kind of undefined behavior. I did make use of anything unsafe, so what gives? Compiler not catch it but should have? Currently the compiler doesn't track where is located the memo

  1   2   >