Re: 4x speedup of recursive rmdir in std.file

2012-02-07 Thread deadalnix
Le 05/02/2012 18:38, Andrei Alexandrescu a écrit : On 2/5/12 10:16 AM, Nick Sabalausky wrote: Jay Norwoodj...@prismnet.com wrote in message news:jgm5vh$hbe$1...@digitalmars.com... == Quote from Nick Sabalausky (a@a.a)'s article Interesting. How does it perform when just running on one core?

Re: An unknown deprecated feature

2012-02-07 Thread Alex Rønne Petersen
On 09-11-2005 16:10, Bruno Medeiros wrote: I just spent half an hour trying to figure out why a certain piece of code wouldn't compile. Puzzled by a cryptic error message, and after reducing it to the simplest form of code: class Bar(TYPE) { Bar!(TYPE) instance; } and still without it

Re: killer App for D? (was: State of D on iOS/Android)

2012-02-07 Thread Steve Teale
On Mon, 06 Feb 2012 12:22:45 +0100, Ludovic Silvestre wrote: Don't you mean Raspberry Pi? Ah, yes - I keep doing that. I have an virtualbox emulator for it up and running, and will try to build GDC within that as soon as I get myself into town and buy more memory. Steve

Re: [OT] I ported Empire to D2 and made it cross platform.

2012-02-07 Thread deadalnix
Le 07/02/2012 07:16, Walter Bright a écrit : On 2/6/2012 8:08 PM, bcs wrote: Some side effect of some long ago licensing agreement with a company that is now nothing more than a fileing cabinet full of paper and a lawyer on retainer? No. Empire is entirely mine. OK, that is understandable.

Re: Should C functions automatically be nothrow?

2012-02-07 Thread deadalnix
Le 07/02/2012 03:04, Jonathan M Davis a écrit : Can C functions throw? I don't know of any way that a C function could throw. Is it possible if you have a C function which calls a D function or something like that? I don't know. I wouldn't really expect the C function to be able to handle the D

Re: assumeSafeAppend and purity

2012-02-07 Thread Timon Gehr
On 02/07/2012 03:48 AM, Steven Schveighoffer wrote: On Mon, 06 Feb 2012 21:32:05 -0500, Vladimir Panteleev vladi...@thecybershadow.net wrote: On Tuesday, 7 February 2012 at 01:47:12 UTC, Jonathan M Davis wrote: At present, assumeSafeAppend isn't pure - nor is capacity or reserve. AFAIK, none

Re: [OT] Programming language WATs

2012-02-07 Thread Timon Gehr
On 02/07/2012 06:49 AM, H. S. Teoh wrote: In D, however, I did not expect this stream/stdio divide to exist, though I suppose the name std.stdio is a kind of giveaway. In any case, std.stdio is used all over the place in D docs and tutorials, besides write/writeln() being a pet example

Re: [OT] Programming language WATs

2012-02-07 Thread Stewart Gordon
On 20/01/2012 20:59, Denis Shelomovskij wrote: 20.01.2012 19:40, Robert Clipsham пишет: Just came across this amusing 4 minute video: https://www.destroyallsoftware.com/talks/wat Good talk! But with a mistake: there are 15 delimiters in 16 element array (printing/join result), not 16.

Re: [OT] Programming language WATs

2012-02-07 Thread Stewart Gordon
On 07/02/2012 01:18, Jonathan M Davis wrote: snip I guess that it depends on how you think or what you're used to. I wouldn't necessarily expect std.stream to be related to std.stdio at all. Certainly. in C++, stream-based and non-stream-based I/O isn't related at all snip std.stream and

Re: Should C functions automatically be nothrow?

2012-02-07 Thread Stewart Gordon
On 07/02/2012 02:04, Jonathan M Davis wrote: Can C functions throw? I don't know of any way that a C function could throw. snip On top of what the others have said, functions written in C can certainly throw such things as AVs. Stewart.

Re: std.uuid is ready for review

2012-02-07 Thread bls
On 02/02/2012 01:26 PM, Johannes Pfau wrote: Hi, std.uuid is ready to be reviewed. As far as I know there's nothing being reviewed right now, so we could start the review as soon as a review manager has been found. About std.uuid (copied from the module documentation): -

Re: Should C functions automatically be nothrow?

2012-02-07 Thread Timon Gehr
On 02/07/2012 02:40 PM, Stewart Gordon wrote: On 07/02/2012 02:04, Jonathan M Davis wrote: Can C functions throw? I don't know of any way that a C function could throw. snip On top of what the others have said, functions written in C can certainly throw such things as AVs. Stewart. AVs are

std.stream vs std.stdio (Was: Re: [OT] Programming language WATs)

2012-02-07 Thread H. S. Teoh
[Changed subject to match where discussion is going.] On Mon, Feb 06, 2012 at 11:27:36PM -0800, Jonathan M Davis wrote: On Monday, February 06, 2012 23:01:06 H. S. Teoh wrote: [...] I don't see what's the discrepancy between formatting and streams. As far as I'm concerned, writeln() is

OT Adam D Ruppe's web stuff

2012-02-07 Thread bls
You know it, web stuff documentation is a weak point. web stuff looks very interesting ... so a real world sample app would be nice.. I would like to see a sample RIA - M- V-C wise, using (say using dojo dijit as View layer ) in conjunction with the D web stuff . (Model- Controler) I

How to save RAM in D programs (on zero initialized buffers)

2012-02-07 Thread Marco Leise
Hi, this is me again with some size matters topic. This time, it's not the executable size, no! Instead I want to discuss a runtime memory footprint and speed issue that affects everyone, and how to improve the situation dramatically. In D we allocate memory through the GC, that is

Re: How to save RAM in D programs (on zero initialized buffers)

2012-02-07 Thread Marco Leise
Aw Opera fooled me again into answering a post, instead of creating a new one - ignore this, I'll repost a proper thread.

How to save RAM in D programs (on zero initialized buffers): Reloaded

2012-02-07 Thread Marco Leise
Hi, this is me again with some size matters topic. This time, it's not the executable size, no! Instead I want to discuss a runtime memory footprint and speed issue that affects everyone, and how to improve the situation dramatically. In D we allocate memory through the GC, that is initialized

Re: Should C functions automatically be nothrow?

2012-02-07 Thread Walter Bright
On 2/7/2012 5:40 AM, Stewart Gordon wrote: On 07/02/2012 02:04, Jonathan M Davis wrote: Can C functions throw? I don't know of any way that a C function could throw. snip On top of what the others have said, functions written in C can certainly throw such things as AVs. Although seg faults

Re: OT Adam D Ruppe's web stuff

2012-02-07 Thread Adam D. Ruppe
On Tuesday, 7 February 2012 at 19:27:46 UTC, bls wrote: You know it, web stuff documentation is a weak point. Yeah, I know. looks very interesting ... so a real world sample app would be nice.. The closest i have is a little blog like thing that I started and haven't worked on since.

Re: How to save RAM in D programs (on zero initialized buffers): Reloaded

2012-02-07 Thread Nick Sabalausky
Is void initialization not good enough? IIRC it's something like: ubyte[] buf = void;

Re: How to save RAM in D programs (on zero initialized buffers)

2012-02-07 Thread Marco Leise
Am 07.02.2012, 21:11 Uhr, schrieb Nick Sabalausky a@a.a: Is void initialization not good enough? IIRC it's something like: ubyte[] buf = void; That gives me a) no buffer, who's pointer is b) not initialized to null. I want instead a defined pointer, to a valid array, that is initialized to

Re: Should C functions automatically be nothrow?

2012-02-07 Thread H. S. Teoh
On Tue, Feb 07, 2012 at 11:53:45AM -0800, Walter Bright wrote: On 2/7/2012 5:40 AM, Stewart Gordon wrote: On 07/02/2012 02:04, Jonathan M Davis wrote: Can C functions throw? I don't know of any way that a C function could throw. snip On top of what the others have said, functions written

Re: How to save RAM in D programs (on zero initialized buffers)

2012-02-07 Thread Michel Fortin
On 2012-02-07 20:24:40 +, Marco Leise marco.le...@gmx.de said: Am 07.02.2012, 21:11 Uhr, schrieb Nick Sabalausky a@a.a: Is void initialization not good enough? IIRC it's something like: ubyte[] buf = void; That gives me a) no buffer, who's pointer is b) not initialized to null. I want

Re: How to save RAM in D programs (on zero initialized buffers)

2012-02-07 Thread Martin Nowak
On Tue, 07 Feb 2012 21:24:40 +0100, Marco Leise marco.le...@gmx.de wrote: Am 07.02.2012, 21:11 Uhr, schrieb Nick Sabalausky a@a.a: Is void initialization not good enough? IIRC it's something like: ubyte[] buf = void; That gives me a) no buffer, who's pointer is b) not initialized to null.

Re: How to save RAM in D programs (on zero initialized buffers): Reloaded

2012-02-07 Thread Kapps
On 07/02/2012 2:11 PM, Nick Sabalausky wrote: Is void initialization not good enough? IIRC it's something like: ubyte[] buf = void; This example would be uninitializedArray!(ubyte[])(1024 * 1024). I would guess that it gives significantly better performance. There's also

Re: How to save RAM in D programs (on zero initialized buffers): Reloaded

2012-02-07 Thread Iain Buclaw
On 7 February 2012 19:39, Marco Leise marco.le...@gmx.de wrote: Hi, this is me again with some size matters topic. This time, it's not the executable size, no! Instead I want to discuss a runtime memory footprint and speed issue that affects everyone, and how to improve the situation

Re: How to save RAM in D programs (on zero initialized buffers)

2012-02-07 Thread Martin Nowak
On Tue, 07 Feb 2012 21:37:03 +0100, Michel Fortin michel.for...@michelf.com wrote: On 2012-02-07 20:24:40 +, Marco Leise marco.le...@gmx.de said: Am 07.02.2012, 21:11 Uhr, schrieb Nick Sabalausky a@a.a: Is void initialization not good enough? IIRC it's something like: ubyte[] buf =

Output to console from DerivedThread class strange

2012-02-07 Thread Oliver Puerto
Hello, I have a question concerning threading. I use Visual Studio with the Visual-D plugin. The problem is somehow that when executing the code below Derived thread running. is displayed 3 times on the console but not before return 0 is reached. Then Derived thread running. is displayed 3x

Re: Possible to pass a member function to spawn?

2012-02-07 Thread Sean Kelly
On Feb 6, 2012, at 1:38 PM, Oliver Puerto wrote: Hello, I'm very new to D. Just started reading The D programming language. I should read it from beginning to end before posting questions here. I know ... But I'm just too impatient. The issue seems not to be that simple, nevertheless.

Re: Output to console from DerivedThread class strange

2012-02-07 Thread Manu
I'm not sure why you are asking me about this? The problem I think is with your understanding of the debugger, and sleep states of other threads. If you break on a breakpoint to step the program, all threads be stopped. If you step the code one line at a time in the debugger, it will not yield to

Re: How to save RAM in D programs (on zero initialized buffers): Reloaded

2012-02-07 Thread F i L
Can't you just write a custom allocator using calloc for performance critical structures (http://dlang.org/memory.html#newdelete), or do what Iain said.

Re: Possible to pass a member function to spawn?

2012-02-07 Thread Manu
On 8 February 2012 00:33, Sean Kelly s...@invisibleduck.org wrote: On Feb 6, 2012, at 1:38 PM, Oliver Puerto wrote: Hello, I'm very new to D. Just started reading The D programming language. I should read it from beginning to end before posting questions here. I know ... But I'm just

Re: How to save RAM in D programs (on zero initialized buffers): Reloaded

2012-02-07 Thread Timon Gehr
On 02/08/2012 12:01 AM, F i L wrote: Can't you just write a custom allocator using calloc for performance critical structures (http://dlang.org/memory.html#newdelete), or do what Iain said. The solution with the best performance and least memory requirements obviously must be the default.

Re: How to save RAM in D programs (on zero initialized buffers): Reloaded

2012-02-07 Thread Artur Skawina
On 02/08/12 00:01, F i L wrote: Can't you just write a custom allocator using calloc for performance critical structures (http://dlang.org/memory.html#newdelete), or do what Iain said. That won't help - the compiler will defeat the optimization by initializing the area... artur

Re: How to save RAM in D programs (on zero initialized buffers): Reloaded

2012-02-07 Thread F i L
Artur Skawina wrote: That won't help - the compiler will defeat the optimization by initializing the area... I see. Timon Gehr wrote: The solution with the best performance and least memory requirements obviously must be the default. No argument here. Only, if calloc is an all-around

Re: Possible to pass a member function to spawn?

2012-02-07 Thread Sean Kelly
On Feb 7, 2012, at 3:09 PM, Manu wrote: On 8 February 2012 00:33, Sean Kelly s...@invisibleduck.org wrote: On Feb 6, 2012, at 1:38 PM, Oliver Puerto wrote: Hello, I'm very new to D. Just started reading The D programming language. I should read it from beginning to end before posting

Re: Possible to pass a member function to spawn?

2012-02-07 Thread Timon Gehr
On 02/08/2012 12:09 AM, Manu wrote: On 8 February 2012 00:33, Sean Kelly s...@invisibleduck.org mailto:s...@invisibleduck.org wrote: On Feb 6, 2012, at 1:38 PM, Oliver Puerto wrote: Hello, I'm very new to D. Just started reading The D programming language. I should

Re: Possible to pass a member function to spawn?

2012-02-07 Thread Artur Skawina
On 02/08/12 00:32, Sean Kelly wrote: [...] the transitivity of shared can still make for some weirdness at the implementation level. For example, if I have: class Thread { pthread_t p; shared void detach() { pthread_detach(p); } } Building this yields: Error:

Re: Possible to pass a member function to spawn?

2012-02-07 Thread Sean Kelly
On Feb 7, 2012, at 3:55 PM, Artur Skawina wrote: On 02/08/12 00:32, Sean Kelly wrote: [...] the transitivity of shared can still make for some weirdness at the implementation level. For example, if I have: class Thread { pthread_t p; shared void detach() {

Re: Should C functions automatically be nothrow?

2012-02-07 Thread Martin Nowak
On Tue, 07 Feb 2012 20:53:45 +0100, Walter Bright newshou...@digitalmars.com wrote: On 2/7/2012 5:40 AM, Stewart Gordon wrote: On 07/02/2012 02:04, Jonathan M Davis wrote: Can C functions throw? I don't know of any way that a C function could throw. snip On top of what the others have

Re: Possible to pass a member function to spawn?

2012-02-07 Thread Artur Skawina
On 02/08/12 01:41, Sean Kelly wrote: On Feb 7, 2012, at 3:55 PM, Artur Skawina wrote: On 02/08/12 00:32, Sean Kelly wrote: [...] the transitivity of shared can still make for some weirdness at the implementation level. For example, if I have: class Thread { pthread_t p; shared

Re: OT Adam D Ruppe's web stuff

2012-02-07 Thread James Miller
On Tuesday, 7 February 2012 at 19:27:46 UTC, bls wrote: You know it, web stuff documentation is a weak point. Yeah, I know. looks very interesting ...  so a real world sample app would be nice.. The closest i have is a little blog like thing that I started and haven't worked on since.

Re: std.xml and Adam D Ruppe's dom module

2012-02-07 Thread Jonathan M Davis
On Tuesday, February 07, 2012 00:56:40 Adam D. Ruppe wrote: On Monday, 6 February 2012 at 23:47:08 UTC, Jonathan M Davis wrote: Also, two of the major requirements for an improved std.xml are that it needs to have a range-based API, and it needs to be fast. What does range based API

Re: OT Adam D Ruppe's web stuff

2012-02-07 Thread Adam D. Ruppe
On Wednesday, 8 February 2012 at 01:33:51 UTC, James Miller wrote: As somebody that frequently laments the lack of documentation I'm a bit of a hypocrite here; I'll complain until the cows come home about /other/ people's crappy documentation... then turn around and do a bad job at it myself.

Re: OT Adam D Ruppe's web stuff

2012-02-07 Thread Adam D. Ruppe
Here's more ddocs. http://arsdnet.net/web.d/web.html http://arsdnet.net/web.d/dom.html Not terribly useful, I'll admit. The Javascript discussion at the bottom of the first link might be good to read though. The dom.html there is mostly just (incomplete) method listing. I didn't write most of

Re: How to save RAM in D programs (on zero initialized buffers): Reloaded

2012-02-07 Thread Manfred Nowak
Marco Leise wrote: I'm not aware of any caveats, are there any? The tests only cover a very small fraction of an unknown data structure: the allocation phase. Of course one can want to make a bad design running faster. Especially if one need to allocate 0.5 TB main memory and can allocate

Re: How to save RAM in D programs (on zero initialized buffers): Reloaded

2012-02-07 Thread F i L
F i L wrote: Only, if calloc is an all-around better allocation method than malloc, why is malloc even used? Note-to-self: google before asking stupid questions...

Re: How to save RAM in D programs (on zero initialized buffers): Reloaded

2012-02-07 Thread Jose Armando Garcia
On Tue, Feb 7, 2012 at 5:39 PM, Marco Leise marco.le...@gmx.de wrote: Hi, this is me again with some size matters topic. This time, it's not the executable size, no! Instead I want to discuss a runtime memory footprint and speed issue that affects everyone, and how to improve the situation

Re: How to save RAM in D programs (on zero initialized buffers): Reloaded

2012-02-07 Thread Marco Leise
Am 08.02.2012, 04:40 Uhr, schrieb Jose Armando Garcia jsan...@gmail.com: Special? What do you mean by special? Most OS use Virtual Memory so sure they can say here is a page and yet not have that page backed by physical memory. To my knowledge, they can only do this if the allocated memory

Re: How to save RAM in D programs (on zero initialized buffers): Reloaded

2012-02-07 Thread Marco Leise
Am 07.02.2012, 22:15 Uhr, schrieb Iain Buclaw ibuc...@ubuntu.com: o zero out a memory block -- !!! What about these functions? import std.array; byte[][ALLOCS] a, b; writeln(** uninitializedArray!(ubyte[])(1024*1024)); foreach(i; 0 .. ALLOCS) b[i] =

Re: How to save RAM in D programs (on zero initialized buffers)

2012-02-07 Thread Marco Leise
Am 08.02.2012, 04:37 Uhr, schrieb Manfred Nowak svv1...@hotmail.com: Marco Leise wrote: I'm not aware of any caveats, are there any? The tests only cover a very small fraction of an unknown data structure: the allocation phase. Of course one can want to make a bad design running faster.

Why I don't want D to expand

2012-02-07 Thread Bee
It's the wrong thing. It wastes peoples' time. How is it not ALREADY just like C++, in that the human time capital is worth what it is. Surely the compiler-writer who started the monstrosity of D knows this. But you supporters, keep doggin' him. Surely I want you to abandon him so he can move

Re: Why I don't want D to expand

2012-02-07 Thread Bernard Helyer
I understand you have daddy issues that come out when you drink, but can't you start a diary or something?

Re: Why I don't want D to expand

2012-02-07 Thread Daniel Murphy
http://i.qkme.me/eb6.jpg

Re: Output to console from DerivedThread class strange

2012-02-07 Thread Oliver Puerto
Hi Manu, thanks for taking some time to answer. I just wrote a little Java program that does just the same: public static void main(String[] args) { Thread thread1 = new Thread(new HelloWorldThread()); thread1.start(); Thread thread2 = new Thread(new HelloWorldThread());

Re: How to save RAM in D programs (on zero initialized buffers)

2012-02-07 Thread Jacob Carlborg
On 2012-02-07 21:37, Michel Fortin wrote: On 2012-02-07 20:24:40 +, Marco Leise marco.le...@gmx.de said: Am 07.02.2012, 21:11 Uhr, schrieb Nick Sabalausky a@a.a: Is void initialization not good enough? IIRC it's something like: ubyte[] buf = void; That gives me a) no buffer, who's

Re: std.xml and Adam D Ruppe's dom module

2012-02-07 Thread Jacob Carlborg
On 2012-02-08 02:44, Jonathan M Davis wrote: On Tuesday, February 07, 2012 00:56:40 Adam D. Ruppe wrote: On Monday, 6 February 2012 at 23:47:08 UTC, Jonathan M Davis wrote: Also, two of the major requirements for an improved std.xml are that it needs to have a range-based API, and it needs to

Re: OT Adam D Ruppe's web stuff

2012-02-07 Thread Jacob Carlborg
On 2012-02-08 02:33, James Miller wrote: As somebody that frequently laments the lack of documentation in general (I use Silverstripe at work, in which the documentation is patchy at best) I work hard on my documentation. Adam's stuff is very good, I plan to take a look at it and borrow some

Re: OT Adam D Ruppe's web stuff

2012-02-07 Thread Jacob Carlborg
On 2012-02-08 03:29, Adam D. Ruppe wrote: Here's more ddocs. http://arsdnet.net/web.d/web.html http://arsdnet.net/web.d/dom.html Not terribly useful, I'll admit. The Javascript discussion at the bottom of the first link might be good to read though. The dom.html there is mostly just

Conversion to output ranges

2012-02-07 Thread Mafi
Hi, does anybody know how to bring std.conv.to or something similar to output into an output range? int a = 42; char[25] buffer; to!typeof(buffer[])(a, buffer[]); I want to send these texts throw sockets. Therefore I'd like to reuse the buffer. Mafi

Re: Extra packet sent when using socket/socketstream

2012-02-07 Thread Vladimir Panteleev
On Monday, 6 February 2012 at 21:51:54 UTC, Vidar Wahlberg wrote: How can I make it not send a packet warning the recipient that it's about to receive another packet (of a given size)? Don't use std.socketstream. Streams serialize some types in an internal format (in your case, prepending the

DLL Injection

2012-02-07 Thread valente500
I've been trying for a while now to inject a DLL written in D into another process, and I just haven't been able to get it working. Here's the code for the DLL: import std.c.windows.windows; import core.sys.windows.dll; __gshared HINSTANCE g_hInst; extern (Windows) BOOL DllMain(HINSTANCE

Re: Using the Variant (Setting it's memory location)

2012-02-07 Thread Jesse Phillips
On Tuesday, 7 February 2012 at 00:39:00 UTC, Era Scarecrow wrote: Unfortunately I'd need to reference a buffer for the known structured types. Variant seems far more useful for making an interpreted language, than for my purposes. I've been using Variant with LuaD for some time. Sorry it

Re: Conversion to output ranges

2012-02-07 Thread Timon Gehr
On 02/07/2012 02:35 PM, Mafi wrote: Hi, does anybody know how to bring std.conv.to or something similar to output into an output range? int a = 42; char[25] buffer; to!typeof(buffer[])(a, buffer[]); I want to send these texts throw sockets. Therefore I'd like to reuse the buffer. Mafi You

Re: Conversion to output ranges

2012-02-07 Thread Timon Gehr
On 02/07/2012 04:49 PM, Timon Gehr wrote: On 02/07/2012 02:35 PM, Mafi wrote: Hi, does anybody know how to bring std.conv.to or something similar to output into an output range? int a = 42; char[25] buffer; to!typeof(buffer[])(a, buffer[]); I want to send these texts throw sockets. Therefore

Re: Conversion to output ranges

2012-02-07 Thread Timon Gehr
On 02/07/2012 04:50 PM, Timon Gehr wrote: On 02/07/2012 04:49 PM, Timon Gehr wrote: On 02/07/2012 02:35 PM, Mafi wrote: Hi, does anybody know how to bring std.conv.to or something similar to output into an output range? int a = 42; char[25] buffer; to!typeof(buffer[])(a, buffer[]); I want to

Re: Extra packet sent when using socket/socketstream

2012-02-07 Thread Vidar Wahlberg
On 2012-02-07 14:44, Vladimir Panteleev wrote: On Monday, 6 February 2012 at 21:51:54 UTC, Vidar Wahlberg wrote: How can I make it not send a packet warning the recipient that it's about to receive another packet (of a given size)? Don't use std.socketstream. Streams serialize some types in

Re: Conversion to output ranges

2012-02-07 Thread Pedro Lacerda
Maybe std.outbuffer... auto buffer = new OutBuffer(); int a = 42; buffer.write(a); byte[] bytes = cast(byte[]) buffer.toBytes(); ubyte[] ubytes = buffer.toBytes(); Pedro Lacerda 2012/2/7 Mafi m...@example.org Hi, does anybody know how to bring std.conv.to or

Re: Using the Variant (Setting it's memory location)

2012-02-07 Thread Pedro Lacerda
You can roll your own tagged union instead. The S struct can store long and byte[], S.ptr is a pointer to the data. enum Type { Long, Bytes } struct S { Type type; void* ptr; union { long _long; byte[] _bytes; } this(long l)

For: [your code hear]

2012-02-07 Thread Manfred Nowak
Goal: show some skill of D for implementing mathematics. A definition: Let T1, T2, T3 be sets. A problem P of type ( T1, T2, T3) is interpretable as a function from the domain cartesian product of T1 and powerset of T2 to the codomain T3. Objective: Present code, that is usefull for all

Re: For: [your code hear]

2012-02-07 Thread Timon Gehr
On 02/07/2012 08:16 PM, Manfred Nowak wrote: Goal: show some skill of D for implementing mathematics. A definition: Let T1, T2, T3 be sets. A problem P of type ( T1, T2, T3) is interpretable as a function from the domain cartesian product of T1 and powerset of T2 to the codomain T3.

post/pre-increment/decrement and property

2012-02-07 Thread Vidar Wahlberg
Take the following code: int _foo; @property auto foo() { return _foo; } @property auto foo(int foo) { return _foo = foo; } void main() { ++foo; } This won't compile, and it sort of makes sense (at least to me), but is it (or will it in the future be) possible to

Re: post/pre-increment/decrement and property

2012-02-07 Thread Robert Clipsham
On 07/02/2012 22:37, Vidar Wahlberg wrote: Take the following code: int _foo; @property auto foo() { return _foo; } @property auto foo(int foo) { return _foo = foo; } void main() { ++foo; } This won't compile, and it sort of makes sense (at least to me), but is it (or will it in the future be)

Re: post/pre-increment/decrement and property

2012-02-07 Thread Timon Gehr
On 02/07/2012 11:54 PM, Robert Clipsham wrote: On 07/02/2012 22:37, Vidar Wahlberg wrote: Take the following code: int _foo; @property auto foo() { return _foo; } @property auto foo(int foo) { return _foo = foo; } void main() { ++foo; } This won't compile, and it sort of makes sense (at least

How to reverse char[]?

2012-02-07 Thread H. S. Teoh
Hi all, I'm trying to reverse a character array. Why doesn't the following work? import std.algorithm; void main() { char[] array = ['a', 'b', 'c']; reverse(array); } I get: Error: template std.algorithm.reverse(Range) if

Re: How to reverse char[]?

2012-02-07 Thread Timon Gehr
On 02/08/2012 02:29 AM, H. S. Teoh wrote: Hi all, I'm trying to reverse a character array. Why doesn't the following work? import std.algorithm; void main() { char[] array = ['a', 'b', 'c']; reverse(array); } I get: Error: template

Could use some help with porting problems

2012-02-07 Thread Roderick Gibson
So I needed a coherent noise generator and decided to look at libnoise. Noticing it was rather small I decided I would just port it over to d and be done with it, as I expected it would help me understand d a bit better (it has). My problems all seem to stem from the const qualifier, which is

Re: How to reverse char[]?

2012-02-07 Thread James Miller
On 02/08/2012 02:29 AM, H. S. Teoh wrote: Hi all, I'm trying to reverse a character array. Why doesn't the following work?        import std.algorithm;        void main() {                char[] array = ['a', 'b', 'c'];                reverse(array);        } I get: Error: template

Re: How to reverse char[]?

2012-02-07 Thread Jonathan M Davis
On Wednesday, February 08, 2012 02:36:23 Timon Gehr wrote: char[] is handled by Phobos as a range of dchar, ergo it does not have swappable elements. Apparently there is no template specialisation of 'reverse' that handles narrow strings, you might want to file an enhancement request. There

Re: Could use some help with porting problems

2012-02-07 Thread Roderick Gibson
On 2/7/2012 7:58 PM, Daniel Murphy wrote: It seems the problem you've run into is that a class reference cannot be tail-const. Pointers can be tail-const like this: const(Data)* but there is no way currently (there are proposals) to make only the data and not the reference const. A workaround

Re: A GUI library to begin with

2012-02-07 Thread Gour
On Wed, 08 Feb 2012 05:55:37 +0200 Mr. Anonymous mailnew4s...@gmail.com wrote: Has anyone tried these? Any suggestions? wxD (http://wxd.sourceforge.net/) Sincerely, Gour -- Those persons who execute their duties according to My injunctions and who follow this teaching faithfully, without

Re: A GUI library to begin with

2012-02-07 Thread Mr. Anonymous
On 08.02.2012 7:04, Gour wrote: On Wed, 08 Feb 2012 05:55:37 +0200 Mr. Anonymousmailnew4s...@gmail.com wrote: Has anyone tried these? Any suggestions? wxD (http://wxd.sourceforge.net/) Sincerely, Gour The website says: wxD is intended for D language version 1.0, and doesn't work as good

Re: post/pre-increment/decrement and property

2012-02-07 Thread Jacob Carlborg
On 2012-02-08 01:50, Robert Clipsham wrote: On 07/02/2012 23:04, Timon Gehr wrote: Try this: int _foo; @property ref foo() { return _foo; } @property ref foo(int foo) { return _foo = foo; } void main() { ++foo; } Using 'ref' instead of auto returns a reference to _foo, allowing it to

Re: A GUI library to begin with

2012-02-07 Thread Jacob Carlborg
On 2012-02-08 04:55, Mr. Anonymous wrote: Hello, I want to start playing with D, and I'm looking at a GUI library to begin with. From what I see here: http://www.prowiki.org/wiki4d/wiki.cgi?GuiLibraries I have four choices: GtkD, DWT, DFL, DGui. Has anyone tried these? Any suggestions? What

Re: A GUI library to begin with

2012-02-07 Thread Mars
On Wednesday, 8 February 2012 at 03:55:41 UTC, Mr. Anonymous wrote: Has anyone tried these? Any suggestions? What is the status of DWT? What's the difference between DFL and DGui? I've only tried DFL and DGui, since I kinda didn't like the others, and of those two, DFL is the better choice,

[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2012-02-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269 Walter Bright bugzi...@digitalmars.com changed: What|Removed |Added Severity|regression |normal --

[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

2012-02-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4269 --- Comment #15 from Don clugd...@yahoo.com.au 2012-02-07 01:05:27 PST --- So far my patch fixes the original bug report, and about 60% of Daniel's extra test cases. -- Configure issuemail:

[Issue 5915] Newlines are not propagated when copypasting code snippets

2012-02-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5915 --- Comment #5 from Andrej Mitrovic andrej.mitrov...@gmail.com 2012-02-07 02:04:31 PST --- (In reply to comment #3) Where are you pasting the snippets of code? I'm using Opera (Win 7) and the text from

[Issue 4854] Regression(2.047, Mac 10.5 only) writefln Segmentation fault if no globals

2012-02-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4854 --- Comment #15 from Jacob Carlborg d...@me.com 2012-02-07 04:21:38 PST --- I (In reply to comment #14) Is anyone still running 10.5? That's two OSX versions ago. I don't know. But I see now reason why we shouldn't support 10.5 as long as it

[Issue 7456] New: Purity strength not documented

2012-02-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7456 Summary: Purity strength not documented Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: websites

[Issue 7456] Purity strength not documented

2012-02-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7456 Jonathan M Davis jmdavisp...@gmx.com changed: What|Removed |Added CC|

[Issue 7457] New: nested pure functions not specified

2012-02-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7457 Summary: nested pure functions not specified Product: D Version: unspecified Platform: All OS/Version: All Status: NEW Keywords: rejects-valid Severity: normal

[Issue 7458] New: documentation claims non-existent limitation of nested aggregate member functions

2012-02-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7458 Summary: documentation claims non-existent limitation of nested aggregate member functions Product: D Version: D2 Platform: All OS/Version: All Status: NEW

[Issue 7459] New: working around nested function declaration order

2012-02-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7459 Summary: working around nested function declaration order Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: spec Severity: enhancement

[Issue 7452] Function using enforce() cannot be inferred as @safe because of anonymous function due to lazy argument

2012-02-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7452 kenn...@gmail.com changed: What|Removed |Added Summary|Function using enforce()|Function using enforce()

[Issue 5076] std.algorithm.sorted / schwartzSorted

2012-02-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5076 Andrej Mitrovic andrej.mitrov...@gmail.com changed: What|Removed |Added CC|

[Issue 7452] Function using enforce() cannot be inferred as @safe because of anonymous function due to lazy argument

2012-02-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7452 kenn...@gmail.com changed: What|Removed |Added Keywords||pull --- Comment #2 from

[Issue 6332] Auto-return function cannot be inferred as @safe

2012-02-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6332 kenn...@gmail.com changed: What|Removed |Added Keywords|patch |pull --- Comment #2 from

[Issue 5939] Cannot copy std.algorithm.map

2012-02-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5939 d...@dawgfoto.de changed: What|Removed |Added CC||d...@dawgfoto.de --- Comment #10

[Issue 5939] Cannot copy std.algorithm.map

2012-02-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5939 --- Comment #11 from Walter Bright bugzi...@digitalmars.com 2012-02-07 15:31:45 PST --- (In reply to comment #10) int base = 2; map!(a = a + base)(new int[](10)); What we should do to solve this is to infer if a templated struct

  1   2   >