Re: Conversion of delegate with default arguments to delegate with less arguments?

2011-09-02 Thread Andrej Mitrovic
On 9/3/11, Timon Gehr wrote: > Related: I think that function pointers should implicitly decay to > delegates. This would allow the compiler to optimize some delegate > literals to function pointers if they don't access the outer scope, > without breaking any code that wants to use such a function

Re: toString or not toString

2011-09-02 Thread Timon Gehr
On 09/03/2011 01:38 AM, Timon Gehr wrote: I would be very happy to see struct RTTI go away, together with built-in sort. Are there other features that rely on struct RTTI or is it only built-in sort and AAs? And the GC that needs to call destructors obv.

Re: toString or not toString

2011-09-02 Thread Timon Gehr
On 09/02/2011 07:46 PM, Steven Schveighoffer wrote: On Fri, 02 Sep 2011 13:17:02 -0400, Timon Gehr wrote: On 09/02/2011 06:15 PM, Steven Schveighoffer wrote: On Fri, 02 Sep 2011 12:04:08 -0400, Timon Gehr wrote: 2. the format parameter should be completely optional in the signature. This

Re: toString or not toString

2011-09-02 Thread Timon Gehr
On 09/02/2011 11:15 PM, kenji hara wrote: 2011/8/31 Jonathan M Davis: Unfortunately however, the proposal seems to have gone nowhere thus far. Until it does, pretty much every object is just going to use toString without parameters, and the problems with BigInt's toString remain. However, if the

Re: Conversion of delegate with default arguments to delegate with less arguments?

2011-09-02 Thread Timon Gehr
On 09/02/2011 11:49 PM, Andrej Mitrovic wrote: On 9/2/11, Vladimir Panteleev wrote: On Fri, 02 Sep 2011 22:11:50 +0300, Andrej Mitrovic wrote: So maybe this type of conversion is impossible in the first place due to how arguments are passed? Yes. The default value is pushed on the stack a

Re: (Un)justified justification

2011-09-02 Thread Andrej Mitrovic
Yeah what's also weird is that when I clone the repo and build the website via the makefile, copy-pasting works fine in Firefox, but when I try to do it remotely via dpl.org, it doesn't work. I can confirm it works fine in IE8 though. Maybe it's a plugin issue.. hmm

Re: (Un)justified justification

2011-09-02 Thread Jonathan M Davis
On Friday, September 02, 2011 23:54:27 Andrej Mitrovic wrote: > Speaking of websites issues, can anyone else confirm that copy/pasting > code snippets from dpl.org doesn't copy the newlines properly when > pasting into a text editor? I mean neither LF nor CRLF is pasted. > > On the dmars.com site

Re: (Un)justified justification

2011-09-02 Thread Nick Sabalausky
"Nick Sabalausky" wrote in message news:j3rjom$2rem$1...@digitalmars.com... > "Andrej Mitrovic" wrote in message > news:mailman.2652.1315000476.14074.digitalmar...@puremagic.com... >> Speaking of websites issues, can anyone else confirm that copy/pasting >> code snippets from dpl.org doesn't co

Re: Article about problems & suggestions for D 2.0

2011-09-02 Thread Robert Jacques
On Fri, 02 Sep 2011 13:34:12 -0400, Sean Kelly wrote: On Sep 1, 2011, at 7:57 PM, Robert Jacques wrote: On Thu, 01 Sep 2011 11:46:32 -0400, Sean Kelly wrote: Yup. I want to revisit CDGC to see if it's up to snuff as the default GC. It already supports precise scanning, so perhaps the rest

Re: (Un)justified justification

2011-09-02 Thread Nick Sabalausky
"Andrej Mitrovic" wrote in message news:mailman.2652.1315000476.14074.digitalmar...@puremagic.com... > Speaking of websites issues, can anyone else confirm that copy/pasting > code snippets from dpl.org doesn't copy the newlines properly when > pasting into a text editor? I mean neither LF nor CR

Re: toString or not toString

2011-09-02 Thread bearophile
Kenji Hara: > I have posted pull request to fix BigInt's formatting with writef(ln) > <- formattedWrite(). > https://github.com/D-Programming-Language/phobos/pull/230 You are doing good work! I hope to see your patches in the final release of DMD 2.055! Bye, bearophile

Re: (Un)justified justification

2011-09-02 Thread Andrej Mitrovic
Speaking of websites issues, can anyone else confirm that copy/pasting code snippets from dpl.org doesn't copy the newlines properly when pasting into a text editor? I mean neither LF nor CRLF is pasted. On the dmars.com site the snippets can be copied normally.

Re: Conversion of delegate with default arguments to delegate with less arguments?

2011-09-02 Thread Andrej Mitrovic
On 9/2/11, Vladimir Panteleev wrote: > On Fri, 02 Sep 2011 22:11:50 +0300, Andrej Mitrovic > wrote: > >> So maybe this type of conversion is impossible in the first place due >> to how arguments are passed? > > Yes. The default value is pushed on the stack at the call site. Yeah, I should have t

Re: toString or not toString

2011-09-02 Thread kenji hara
2011/8/31 Jonathan M Davis : > Unfortunately however, the proposal seems to have gone nowhere thus far. Until > it does, pretty much every object is just going to use toString without > parameters, and the problems with BigInt's toString remain. However, if the > proposal actually gets implemented,

Re: (Un)justified justification

2011-09-02 Thread Andrei Alexandrescu
On 9/2/11 2:15 PM, Vladimir Panteleev wrote: On Fri, 02 Sep 2011 22:07:29 +0300, Nick Sabalausky wrote: Don't know why I never brought this up until now, but... I know how much Andrei loves justified text, but maybe, just maybe, it's not such a great idea on the website's sidebar menu?: http

Re: (Un)justified justification

2011-09-02 Thread Andrei Alexandrescu
On 9/2/11 2:07 PM, Nick Sabalausky wrote: Don't know why I never brought this up until now, but... I know how much Andrei loves justified text, but maybe, just maybe, it's not such a great idea on the website's sidebar menu?: http://www.semitwist.com/download/img/shots/dpl--justified-is-pretty-

Re: (Un)justified justification

2011-09-02 Thread Nick Sabalausky
"Vladimir Panteleev" wrote in message news:op.v063sazxtuz...@cybershadow.mshome.net... > On Fri, 02 Sep 2011 22:07:29 +0300, Nick Sabalausky wrote: > >> Don't know why I never brought this up until now, but... >> >> I know how much Andrei loves justified text, but maybe, just maybe, it's >> not

Re: Conversion of delegate with default arguments to delegate with less arguments?

2011-09-02 Thread Vladimir Panteleev
On Fri, 02 Sep 2011 22:11:50 +0300, Andrej Mitrovic wrote: So maybe this type of conversion is impossible in the first place due to how arguments are passed? Yes. The default value is pushed on the stack at the call site. I don't know all the technical tidbits, but from a user's point of

Re: (Un)justified justification

2011-09-02 Thread Vladimir Panteleev
On Fri, 02 Sep 2011 22:07:29 +0300, Nick Sabalausky wrote: Don't know why I never brought this up until now, but... I know how much Andrei loves justified text, but maybe, just maybe, it's not such a great idea on the website's sidebar menu?: http://www.semitwist.com/download/img/shots/dpl

Conversion of delegate with default arguments to delegate with less arguments?

2011-09-02 Thread Andrej Mitrovic
Code: void main() { auto foo = (int x = 10){ /* */ }; void delegate() bar = foo; } Since foo takes an argument that already has a default it can be used as a simple `void delegate()`, so maybe it makes sense for `foo` to be able to implicitly convert to such a type. Unfortunately doing a

(Un)justified justification

2011-09-02 Thread Nick Sabalausky
Don't know why I never brought this up until now, but... I know how much Andrei loves justified text, but maybe, just maybe, it's not such a great idea on the website's sidebar menu?: http://www.semitwist.com/download/img/shots/dpl--justified-is-pretty-and-easy-to-read.png

Re: [OT] C++ tips for a D programmer

2011-09-02 Thread Jose Armando Garcia
On Thu, Sep 1, 2011 at 5:57 AM, Lars T. Kyllingstad wrote: > On Wed, 31 Aug 2011 08:55:38 +, Lars T. Kyllingstad wrote: > >> I am starting in a new job on Monday, in which the primary programming >> language is C++.  For the past four years I've had the privilege of >> being able to use D both

Re: toString or not toString

2011-09-02 Thread Jacob Carlborg
On 2011-09-02 19:16, Andrej Mitrovic wrote: On 9/2/11, Jacob Carlborg wrote: Note that to!string and/or write(f)(ln) could be implemented to inspect the fields and just print them in some standard format. This would allow you to skip implementing toString/writeTo in simple cases like the above.

Re: ScintillaD 0.0.1

2011-09-02 Thread bearophile
Zhang: > Project url: https://bitbucket.org/heromyth/scintillad > Current status: Not runnable, but compilable and debuggable. Have you found something in D/Phobos that has caused you troubles? After your experience do you desire something in D/Phobos to be different? Bye, bearophile

Re: ScintillaD 0.0.1

2011-09-02 Thread Nick Sabalausky
"zhang" wrote in message news:mailman.2638.1314964940.14074.digitalmar...@puremagic.com... > ScintillaD is a D port of Scintilla which is implemented in C++. > > Scintilla is an excellent editing component. > > The GUI toolkit which ScintillaD lies on is WindowsApi on Windows. > > The ScintillaD'

Re: toString or not toString

2011-09-02 Thread Steven Schveighoffer
On Fri, 02 Sep 2011 13:17:02 -0400, Timon Gehr wrote: On 09/02/2011 06:15 PM, Steven Schveighoffer wrote: On Fri, 02 Sep 2011 12:04:08 -0400, Timon Gehr wrote: 2. the format parameter should be completely optional in the signature. This is probably impossible. Just for the object case alo

Re: Article about problems & suggestions for D 2.0

2011-09-02 Thread Sean Kelly
On Sep 1, 2011, at 7:57 PM, Robert Jacques wrote: > On Thu, 01 Sep 2011 11:46:32 -0400, Sean Kelly wrote: >> Yup. I want to revisit CDGC to see if it's up to snuff as the default GC. It >> already supports precise scanning, so perhaps the rest can be sorted via >> library code: create!T(...) >

Re: toString or not toString

2011-09-02 Thread Timon Gehr
On 09/02/2011 06:15 PM, Steven Schveighoffer wrote: On Fri, 02 Sep 2011 12:04:08 -0400, Timon Gehr wrote: On 09/02/2011 03:47 PM, Steven Schveighoffer wrote: The sink type could be aliased. But this is really getting into minor issues :) The amount of power and performance you get by switch

Re: toString or not toString

2011-09-02 Thread Andrej Mitrovic
On 9/2/11, Jacob Carlborg wrote: > Note that to!string and/or write(f)(ln) could be implemented to inspect > the fields and just print them in some standard format. This would allow > you to skip implementing toString/writeTo in simple cases like the above. http://codepad.org/1PZY7YTX But I'm pr

Re: Review Queue: std.log, std.regionallocator, or something else?

2011-09-02 Thread Timon Gehr
On 09/02/2011 04:47 PM, Marco Leise wrote: Am 02.09.2011, 14:54 Uhr, schrieb Robert Jacques : On Thu, 01 Sep 2011 14:58:07 -0400, David Nadlinger wrote: On 9/1/11 8:45 PM, Don wrote: While on this bikeshedding issue -- the name 'regionallocator' is horribly long for such an important object

Re: toString or not toString

2011-09-02 Thread Steven Schveighoffer
On Fri, 02 Sep 2011 12:04:08 -0400, Timon Gehr wrote: On 09/02/2011 03:47 PM, Steven Schveighoffer wrote: The sink type could be aliased. But this is really getting into minor issues :) The amount of power and performance you get by switching to writeTo is well worth the extra parameters.

Re: toString or not toString

2011-09-02 Thread Steven Schveighoffer
On Fri, 02 Sep 2011 11:46:19 -0400, Timon Gehr wrote: On 09/02/2011 03:59 PM, Steven Schveighoffer wrote: On Fri, 02 Sep 2011 06:17:53 -0400, Timon Gehr wrote: On 09/02/2011 03:29 AM, Don wrote: If you're concerned about speed, the writeTo method is much quicker, since it doesn't requ

Re: toString or not toString

2011-09-02 Thread Timon Gehr
On 09/02/2011 03:47 PM, Steven Schveighoffer wrote: On Thu, 01 Sep 2011 17:09:30 -0400, Timon Gehr wrote: On 09/01/2011 10:57 PM, Steven Schveighoffer wrote: On Thu, 01 Sep 2011 16:26:55 -0400, Timon Gehr wrote: On 09/01/2011 09:41 PM, Don wrote: On 31.08.2011 14:35, Timon Gehr wrote: On

Re: toString or not toString

2011-09-02 Thread Timon Gehr
On 09/02/2011 03:59 PM, Steven Schveighoffer wrote: On Fri, 02 Sep 2011 06:17:53 -0400, Timon Gehr wrote: On 09/02/2011 03:29 AM, Don wrote: If you're concerned about speed, the writeTo method is much quicker, since it doesn't require any heap activity at all. allocating a new string on

Re: Fast file copy (threaded or not?)

2011-09-02 Thread Marco Leise
Am 02.09.2011, 16:08 Uhr, schrieb Andrej Mitrovic : On 9/2/11, Walter Bright wrote: On Windows, we should just stick with the Windows CopyFile function: http://msdn.microsoft.com/en-us/library/aa363851(v=vs.85).aspx And let the MS guys do their thing. Presumably they will do what works b

Re: Review Queue: std.log, std.regionallocator, or something else?

2011-09-02 Thread Marco Leise
Am 02.09.2011, 14:54 Uhr, schrieb Robert Jacques : On Thu, 01 Sep 2011 14:58:07 -0400, David Nadlinger wrote: On 9/1/11 8:45 PM, Don wrote: While on this bikeshedding issue -- the name 'regionallocator' is horribly long for such an important object. I think if it stays with a long-winded n

Re: ScintillaD 0.0.1

2011-09-02 Thread Andrej Mitrovic
Very, very cool! It builds lightning fast here. What's stopping it from running though? Have you ran into bugs or does the port need more work?

Re: Fast file copy (threaded or not?)

2011-09-02 Thread Andrej Mitrovic
On 9/2/11, Walter Bright wrote: > On Windows, we should just stick with the Windows CopyFile function: > > http://msdn.microsoft.com/en-us/library/aa363851(v=vs.85).aspx > > And let the MS guys do their thing. Presumably they will do what works best > on > Windows. > I've given OP's code a few te

Re: Review Queue: std.log, std.regionallocator, or something else?

2011-09-02 Thread Steven Schveighoffer
On Fri, 02 Sep 2011 09:43:38 -0400, Daniel Murphy wrote: "Timon Gehr" wrote in message news:j3q9o4$j3k$1...@digitalmars.com... BTW, any suggestions for a name for a function like this? I can't think of a good one. Best suited would be 'New', but that would probably be against Phobos

Re: toString or not toString

2011-09-02 Thread Steven Schveighoffer
On Fri, 02 Sep 2011 06:17:53 -0400, Timon Gehr wrote: On 09/02/2011 03:29 AM, Don wrote: If you're concerned about speed, the writeTo method is much quicker, since it doesn't require any heap activity at all. allocating a new string on the heap always requires heap activity. I was bench

Re: toString or not toString

2011-09-02 Thread Steven Schveighoffer
On Thu, 01 Sep 2011 17:09:30 -0400, Timon Gehr wrote: On 09/01/2011 10:57 PM, Steven Schveighoffer wrote: On Thu, 01 Sep 2011 16:26:55 -0400, Timon Gehr wrote: On 09/01/2011 09:41 PM, Don wrote: On 31.08.2011 14:35, Timon Gehr wrote: On 08/31/2011 04:41 AM, Jonathan M Davis wrote: Obje

Re: Review Queue: std.log, std.regionallocator, or something else?

2011-09-02 Thread Daniel Murphy
"Timon Gehr" wrote in message news:j3q9o4$j3k$1...@digitalmars.com... >> BTW, any suggestions for a name for a function like this? I can't think >> of a good >> one. >> > > Best suited would be 'New', but that would probably be against Phobos > naming conventions (we could add an exception fo

Re: Review Queue: std.log, std.regionallocator, or something else?

2011-09-02 Thread Robert Jacques
On Thu, 01 Sep 2011 14:58:07 -0400, David Nadlinger wrote: On 9/1/11 8:45 PM, Don wrote: While on this bikeshedding issue -- the name 'regionallocator' is horribly long for such an important object. I think if it stays with a long-winded name, it won't be used as frequently as it deserves. I

ScintillaD 0.0.1

2011-09-02 Thread zhang
ScintillaD is a D port of Scintilla which is implemented in C++. Scintilla is an excellent editing component. The GUI toolkit which ScintillaD lies on is WindowsApi on Windows. The ScintillaD's APIs are almost identical with Scintilla's. The changes to APIs are done mainly in order to use the pr

Re: toString or not toString

2011-09-02 Thread Timon Gehr
On 09/02/2011 03:29 AM, Don wrote: On 01.09.2011 23:35, Timon Gehr wrote: On 09/01/2011 11:15 PM, kennytm wrote: Timon Gehr wrote: On 09/01/2011 09:41 PM, Don wrote: On 31.08.2011 14:35, Timon Gehr wrote: On 08/31/2011 04:41 AM, Jonathan M Davis wrote: Objects would have writeTo and toStrin

Re: Review Queue: std.log, std.regionallocator, or something else?

2011-09-02 Thread Timon Gehr
On 09/02/2011 06:20 AM, dsimcha wrote: == Quote from dsimcha (dsim...@yahoo.com)'s article == Quote from Timon Gehr (timon.g...@gmx.ch)'s article Allocating a class or struct instance with a given allocator seems not to be part of the standard allocator interface. Why is that? Pure oversight.

Re: Fast file copy (threaded or not?)

2011-09-02 Thread Jonathan M Davis
On Friday, September 02, 2011 04:58:46 zeljkog wrote: > Marco Leise Wrote: > > void main(string[] args) > > { > > > > if (!enforce(args.length == 3, { > > > > stderr.writefln("%s SOURCE DEST", args[0]); > > > > })) return; > > > > auto sw = StopWatch(); >

Re: Fast file copy (threaded or not?)

2011-09-02 Thread Walter Bright
On 9/1/2011 1:13 PM, Marco Leise wrote: I split the discussion with Andrei about the benefit of a multi-threaded file copy routine to its own thread. This is about copying a file from and to the same HDD - a mechanical disk with seek times. On Windows, we should just stick with the Windows Copy

Re: Fast file copy (threaded or not?)

2011-09-02 Thread zeljkog
Marco Leise Wrote: > > void main(string[] args) > { > if (!enforce(args.length == 3, { > stderr.writefln("%s SOURCE DEST", args[0]); > })) return; > > auto sw = StopWatch(); > sw.start(); > > auto src = new MmFile(args[1], MmFile.Mode.Read, 0, null, 0); > a

Re: Fast file copy (threaded or not?)

2011-09-02 Thread Johannes Pfau
Marco Leise wrote: >I split the discussion with Andrei about the benefit of a >multi-threaded file copy routine to its own thread. >This is about copying a file from and to the same HDD - a mechanical >disk with seek times. > >My testing showed that Andrei is correct with the assumption that the