Re: D 1.076 Alpha for Windows 64 bits, works with VS 2010

2012-10-09 Thread Don Clugston
On 06/10/12 20:38, Walter Bright wrote: On 9/30/2012 9:35 PM, Andrej Mitrovic wrote: On 10/1/12, Walter Bright newshou...@digitalmars.com wrote: Also, consider that in C++ you can throw any type, such as an int. There is no credible way to make this work reasonably in D, as exceptions are all

Re: Remus

2012-10-09 Thread Namespace
As promised, a little description of Remus. :) Not Null references: I chose this syntax: int b = a; because I like it in C++. This syntax is recognized by Remus and is converted to: Ref!(int) b = a; If you must give a reference to a function or other things like that, you can write: [code]

Re: Remus

2012-10-09 Thread bearophile
Namespace: Not Null references: I chose this syntax: int b = a; because I like it in C++. This syntax is recognized by Remus and is converted to: Ref!(int) b = a; If you must give a reference to a function or other things like that, you can write: [code] Foo obj = new Foo();

Re: Remus

2012-10-09 Thread thedeemon
On Tuesday, 9 October 2012 at 19:34:01 UTC, Namespace wrote: Stack Instances: There aren't many words for: if you need a stack instance, write: local Foo f = new Foo(); it's more or less the same as scope. What's the difference between this and std.typecons.scoped, except for alignment and

Re: Remus

2012-10-09 Thread Namespace
This seems far from being well designed not-nullable pointers/class references :-( And why not? In my test cases, they fulfilled their task / purpose very well. And you ask for what namespaces are usefull? Aren't you miss them? I do, and so I implement them. You can already write

Re: Will the D GC be awesome?

2012-10-09 Thread Jacob Carlborg
On 2012-10-09 00:44, Ben Davis wrote: In fairness to Java, it does share the inner char array between strings when you request a substring. (Inside the String class you'll find a reference to a char array, and 'start' and 'count' ints.) The String object itself though (which is small and wraps

Re: core.simd woes

2012-10-09 Thread Manu
On 9 October 2012 02:38, F i L witte2...@gmail.com wrote: Iain Buclaw wrote: I'm refusing to implement any intrinsic that is tied to a specific architecture. I see. So the __builtin_ia32_***() functions in gcc.builtins are architecture agnostic? I couldn't find much documentation about

Re: core.simd woes

2012-10-09 Thread Manu
On 9 October 2012 02:52, David Nadlinger s...@klickverbot.at wrote: Is core.simd designed to really never be used and Manu's std.simd is really the starting place for libraries? (I believe I remember him mentioning that) With all due respect to Walter, core.simd isn't really designed much

Re: Windows DLLs and TLS

2012-10-09 Thread Jakob Ovrum
On Monday, 8 October 2012 at 19:19:58 UTC, Denis Shelomovskij wrote: As I said, give us a runnable failing test suite. Here's a reduced plugin with VisualD project files and all dependencies. http://filesmelt.com/dl/bugdist.rar It uses the standard DllMain, and the only thing

Re: Windows DLLs and TLS

2012-10-09 Thread Jakob Ovrum
On Tuesday, 9 October 2012 at 08:41:46 UTC, Jakob Ovrum wrote: On Monday, 8 October 2012 at 19:19:58 UTC, Denis Shelomovskij wrote: As I said, give us a runnable failing test suite. Here's a reduced plugin with VisualD project files and all dependencies. http://filesmelt.com/dl/bugdist.rar

Re: Preliminary submission - std.rational and std.typelist

2012-10-09 Thread Aziz K.
On Mon, 08 Oct 2012 23:01:42 +0200, Ellery Newcomer ellery-newco...@utulsa.edu wrote: Wasn't Paul D. Anderson working on a BigFloat? Thanks for the hint. I found his project on github: https://github.com/andersonpd/decimal Seems fairly complete and usable. Hope he's going to continue to

Re: Windows DLLs and TLS

2012-10-09 Thread Regan Heath
On Mon, 08 Oct 2012 19:32:40 +0100, Jakob Ovrum jakobov...@gmail.com wrote: XChat uses gmodule - part of glib - to load plugins. I looked at gmodule's Windows implementation, and it uses LoadLibraryW. Does your dummy C host application also use gmodule to load the dll.. that might be a

Re: core.simd woes

2012-10-09 Thread Iain Buclaw
On 9 October 2012 00:52, David Nadlinger s...@klickverbot.at wrote: On Monday, 8 October 2012 at 21:36:08 UTC, F i L wrote: Iain Buclaw wrote: float a = 1, b = 2, c = 3, d = 4; float4 f = [a,b,c,d]; === movss -16(%rbp), %xmm0 movss -12(%rbp), %xmm1 Nice, not even DMD

Re: DMD 2.060

2012-10-09 Thread Russel Winder
On Sun, 2012-10-07 at 12:30 +0100, Russel Winder wrote: On Sun, 2012-10-07 at 03:39 -0700, Walter Bright wrote: On 10/7/2012 3:12 AM, Alex Rønne Petersen wrote: On 07-10-2012 11:11, Russel Winder wrote: Any news on the regressions relating to threads in the 2.059 → 2.060 change? Is a

Re: Windows DLLs and TLS

2012-10-09 Thread Jakob Ovrum
On Tuesday, 9 October 2012 at 10:21:58 UTC, Regan Heath wrote: On Mon, 08 Oct 2012 19:32:40 +0100, Jakob Ovrum jakobov...@gmail.com wrote: XChat uses gmodule - part of glib - to load plugins. I looked at gmodule's Windows implementation, and it uses LoadLibraryW. Does your dummy C host

Re: Windows DLLs and TLS

2012-10-09 Thread Jakob Ovrum
On Tuesday, 9 October 2012 at 10:21:58 UTC, Regan Heath wrote: Does your dummy C host application also use gmodule to load the dll.. that might be a useful experiment perhaps. R The problem has now been reduced to these two palatable programs. bug.dll --- import

Re: OutputRange should be infinite?

2012-10-09 Thread Steven Schveighoffer
On Sat, 06 Oct 2012 04:07:41 -0400, monarch_dodra monarchdo...@gmail.com wrote: On Saturday, 6 October 2012 at 05:24:06 UTC, Steven Schveighoffer wrote: On Fri, 05 Oct 2012 11:15:44 -0400, monarch_dodra monarchdo...@gmail.com wrote: However, I that the isOutputRange definition should

Re: Proposal: __traits(code, ...) and/or .codeof

2012-10-09 Thread luka8088
Is this at least similar to what you had in mind ? http://dpaste.dzfl.pl/a5dc2875 module program; import std.stdio; mixin template BankAccount () { public int amount; void deposit (int value) { this.amount += value; } void withdraw (int value) { this.amount -= value; } auto

Re: OutputRange should be infinite?

2012-10-09 Thread monarch_dodra
On Tuesday, 9 October 2012 at 13:22:28 UTC, Steven Schveighoffer wrote: [SNIP] I tend to disagree with your examples, because, you are mixing the notion of run-time failure with logic error. For example: new New can fail. And you don't know unless you try. But new will throw an exception

Re: Windows DLLs and TLS

2012-10-09 Thread Andrej Mitrovic
On 10/9/12, Jakob Ovrum jakobov...@gmail.com wrote: The problem has now been reduced to these two palatable programs. I get garbage values via LoadLibrary on both XP and Win7 (both x32). I haven't tried glib's version but I don't think it does anything differently. See _g_module_open and

Re: Windows DLLs and TLS

2012-10-09 Thread Jakob Ovrum
On Tuesday, 9 October 2012 at 14:09:52 UTC, Andrej Mitrovic wrote: On 10/9/12, Jakob Ovrum jakobov...@gmail.com wrote: The problem has now been reduced to these two palatable programs. I get garbage values via LoadLibrary on both XP and Win7 (both x32). I haven't tried glib's version but I

Re: OutputRange should be infinite?

2012-10-09 Thread Jakob Ovrum
On Tuesday, 9 October 2012 at 14:03:36 UTC, monarch_dodra wrote: I tend to disagree with your examples, because, you are mixing the notion of run-time failure with logic error. For example: new New can fail. And you don't know unless you try. But new will throw an exception to tell you it

Re: core.simd woes

2012-10-09 Thread Jacob Carlborg
On 2012-10-09 09:50, Manu wrote: std.simd already does have a mammoth mess of static if(arch compiler). The thing about std.simd is that it's designed to be portable, so it doesn't make sense to expose the low-level sse intrinsics directly there. But giving it some thought, it might be nice to

Re: core.simd woes

2012-10-09 Thread jerro
An alternative approach is to have one module per architecture or compiler. You mean like something like std.simd.x86_gdc? In this case a user would need to write a different version of his code for each compiler or write his own wrappers (which is basically what we have now). This could

rvalue arguments passable as const references

2012-10-09 Thread martin
Hi there, I'd like to propose an implicit rvalue-to-const-ref conversion. Basically, we have 5 categories of function parameters: void foo(T)(T copy, in T constCopy, ref T reference, in ref T constReference, out T result) { ... } // in ref T constReference is equivalent to ref const(T)

Re: core.simd woes

2012-10-09 Thread Simen Kjaeraas
On 2012-10-09, 16:20, jerro wrote: An alternative approach is to have one module per architecture or compiler. You mean like something like std.simd.x86_gdc? In this case a user would need to write a different version of his code for each compiler or write his own wrappers (which is

Re: OutputRange should be infinite?

2012-10-09 Thread Steven Schveighoffer
On Tue, 09 Oct 2012 09:39:32 -0400, monarch_dodra monarchdo...@gmail.com wrote: On Tuesday, 9 October 2012 at 13:22:28 UTC, Steven Schveighoffer wrote: [SNIP] I tend to disagree with your examples, because, you are mixing the notion of run-time failure with logic error. They are one

Re: OutputRange should be infinite?

2012-10-09 Thread monarch_dodra
On Tuesday, 9 October 2012 at 15:27:44 UTC, Steven Schveighoffer wrote: On Tue, 09 Oct 2012 09:39:32 -0400, monarch_dodra monarchdo...@gmail.com wrote: On Tuesday, 9 October 2012 at 13:22:28 UTC, Steven Schveighoffer wrote: [SNIP] I tend to disagree with your examples, because, you are

Re: core.simd woes

2012-10-09 Thread Jacob Carlborg
On 2012-10-09 16:52, Simen Kjaeraas wrote: Nope, like: module std.simd; version(Linux64) { public import std.internal.simd_linux64; } Then all std.internal.simd_* modules have the same public interface, and only the version that fits /your/ platform will be included. Exactly, what he

Re: core.simd woes

2012-10-09 Thread David Nadlinger
On Tuesday, 9 October 2012 at 10:29:25 UTC, Iain Buclaw wrote: Vector types already support the same basic operations that can be done on D arrays. So that itself guarantees cross platform. That's obviously true, but not at all enough for most of the interesting use cases of vector types

Re: core.simd woes

2012-10-09 Thread David Nadlinger
On Tuesday, 9 October 2012 at 10:29:25 UTC, Iain Buclaw wrote: Vector types already support the same basic operations that can be done on D arrays. So that itself guarantees cross platform. That's obviously true, but not at all enough for most of the interesting use cases of vector types

Re: [OT] Re: Windows DLLs and TLS

2012-10-09 Thread Denis Shelomovskij
09.10.2012 0:51, Rainer Schuetze пишет: On 10/8/2012 8:13 PM, Denis Shelomovskij wrote: 08.10.2012 21:47, Rainer Schuetze пишет: Implicite TLS for dynamically loaded DLLs is not supported by XP or Sever 2003, so druntime contains a fix to simulate it. (The workaround has the drawback that

Re: Windows DLLs and TLS

2012-10-09 Thread Denis Shelomovskij
09.10.2012 12:29, Jakob Ovrum пишет: On Tuesday, 9 October 2012 at 08:41:46 UTC, Jakob Ovrum wrote: On Monday, 8 October 2012 at 19:19:58 UTC, Denis Shelomovskij wrote: As I said, give us a runnable failing test suite. Here's a reduced plugin with VisualD project files and all dependencies.

Re: Preliminary submission - std.rational and std.typelist

2012-10-09 Thread Paul D. Anderson
On Monday, 8 October 2012 at 15:14:35 UTC, Aziz K. wrote: Incidentally, I would very much need a BigFloat class/struct, written in D and independent of any C library. I'm trying to write one myself, but it seems to be rather tricky. Could this be implemented in a short amount of time by

Re: core.simd woes

2012-10-09 Thread jerro
On Tuesday, 9 October 2012 at 16:59:58 UTC, Jacob Carlborg wrote: On 2012-10-09 16:52, Simen Kjaeraas wrote: Nope, like: module std.simd; version(Linux64) { public import std.internal.simd_linux64; } Then all std.internal.simd_* modules have the same public interface, and only the

next_permutation and cartesian product for ranges?

2012-10-09 Thread H. S. Teoh
Recently I've been working on some computational geometry code, and noticed that Phobos doesn't have any equivalent of STL's next_permutation. I saw there were some discussions about this back in 2010 -- did anything come of it? If there is any interest in next_permutation, I'd also like to

Re: OutputRange should be infinite?

2012-10-09 Thread Steven Schveighoffer
On Tue, 09 Oct 2012 11:52:29 -0400, monarch_dodra monarchdo...@gmail.com wrote: On Tuesday, 9 October 2012 at 15:27:44 UTC, Steven Schveighoffer wrote: On Tue, 09 Oct 2012 09:39:32 -0400, monarch_dodra monarchdo...@gmail.com wrote: On Tuesday, 9 October 2012 at 13:22:28 UTC, Steven

Re: OutputRange should be infinite?

2012-10-09 Thread Andrei Alexandrescu
On 10/9/12 11:52 AM, monarch_dodra wrote: On Tuesday, 9 October 2012 at 15:27:44 UTC, Steven Schveighoffer wrote: On Tue, 09 Oct 2012 09:39:32 -0400, monarch_dodra monarchdo...@gmail.com wrote: On Tuesday, 9 October 2012 at 13:22:28 UTC, Steven Schveighoffer wrote: [SNIP] I tend to

Re: OutputRange should be infinite?

2012-10-09 Thread Steven Schveighoffer
On Tue, 09 Oct 2012 14:18:30 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 10/9/12 11:52 AM, monarch_dodra wrote: On Tuesday, 9 October 2012 at 15:27:44 UTC, Steven Schveighoffer wrote: On Tue, 09 Oct 2012 09:39:32 -0400, monarch_dodra monarchdo...@gmail.com wrote: On

Re: next_permutation and cartesian product for ranges?

2012-10-09 Thread Andrei Alexandrescu
On 10/9/12 1:52 PM, H. S. Teoh wrote: Recently I've been working on some computational geometry code, and noticed that Phobos doesn't have any equivalent of STL's next_permutation. I saw there were some discussions about this back in 2010 -- did anything come of it? If there is any interest in

Re: [OT] Re: Windows DLLs and TLS

2012-10-09 Thread Rainer Schuetze
On 10/9/2012 6:59 PM, Denis Shelomovskij wrote: 09.10.2012 0:51, Rainer Schuetze пишет: On 10/8/2012 8:13 PM, Denis Shelomovskij wrote: 08.10.2012 21:47, Rainer Schuetze пишет: Is your code doing callbacks into the host application in static initializers? With the XP workaround, the

Re: core.simd woes

2012-10-09 Thread F i L
Manu wrote: std.simd already does have a mammoth mess of static if(arch compiler). The thing about std.simd is that it's designed to be portable, so it doesn't make sense to expose the low-level sse intrinsics directly there. Well, that's not really what I was suggesting. I was saying maybe

Re: core.simd woes

2012-10-09 Thread F i L
On Tuesday, 9 October 2012 at 19:18:35 UTC, F i L wrote: Manu wrote: std.simd already does have a mammoth mess of static if(arch compiler). The thing about std.simd is that it's designed to be portable, so it doesn't make sense to expose the low-level sse intrinsics directly there. Well,

Re: next_permutation and cartesian product for ranges?

2012-10-09 Thread Jonathan M Davis
On Tuesday, October 09, 2012 14:25:13 Andrei Alexandrescu wrote: We need that badly. Please implement pronto and let us destroy you for having done so. Sounds violent. :) - Jonathan M Davis

Re: next_permutation and cartesian product for ranges?

2012-10-09 Thread H. S. Teoh
On Tue, Oct 09, 2012 at 02:25:13PM -0400, Andrei Alexandrescu wrote: On 10/9/12 1:52 PM, H. S. Teoh wrote: [...] If there is any interest in next_permutation, I'd also like to propose a next_even_permutation for ranges without duplicate elements. There is a simple way of extending Narayana

Re: next_permutation and cartesian product for ranges?

2012-10-09 Thread Timon Gehr
On 10/09/2012 10:46 PM, H. S. Teoh wrote: On Tue, Oct 09, 2012 at 02:25:13PM -0400, Andrei Alexandrescu wrote: On 10/9/12 1:52 PM, H. S. Teoh wrote: [...] If there is any interest in next_permutation, I'd also like to propose a next_even_permutation for ranges without duplicate elements.

Re: next_permutation and cartesian product for ranges?

2012-10-09 Thread bearophile
Andrei Alexandrescu: Yes, we need next_permutation. It will be up to you to convince the Grand Inquisition Committee of Reviewers that next_even_permutation is necessary and/or sufficient. I don't like the design of C++ STL here. Instead of a next_permutation(), what about ranges that yield

Re: next_permutation and cartesian product for ranges?

2012-10-09 Thread Timon Gehr
On 10/09/2012 11:23 PM, bearophile wrote: Andrei Alexandrescu: Yes, we need next_permutation. It will be up to you to convince the Grand Inquisition Committee of Reviewers that next_even_permutation is necessary and/or sufficient. I don't like the design of C++ STL here. Instead of a

Re: next_permutation and cartesian product for ranges?

2012-10-09 Thread ixid
struct Spermutations { The naming scheme could do with... improvement.

Re: next_permutation and cartesian product for ranges?

2012-10-09 Thread bearophile
ixid: The naming scheme could do with... improvement. struct PermutationSwaps then? Bye, bearophile

Re: next_permutation and cartesian product for ranges?

2012-10-09 Thread Andrei Alexandrescu
On 10/9/12 4:46 PM, H. S. Teoh wrote: On Tue, Oct 09, 2012 at 02:25:13PM -0400, Andrei Alexandrescu wrote: On 10/9/12 1:52 PM, H. S. Teoh wrote: [...] If there is any interest in next_permutation, I'd also like to propose a next_even_permutation for ranges without duplicate elements. There is

Re: SQL working [ was Re: The sorry state of the D stack? ]

2012-10-09 Thread Mark Lamberton
As a D newbie, Thomas' post is quite timely. I've collected all the books on offer and scanned the 'net for anything D related. Like Thomas, I was starting to feel that D was going nowhere fast. Some of the comments here have helped dispel this impression, but it's true to say that from an

Re: next_permutation and cartesian product for ranges?

2012-10-09 Thread Steven Schveighoffer
On Tue, 09 Oct 2012 17:23:07 -0400, bearophile bearophileh...@lycos.com wrote: Andrei Alexandrescu: Yes, we need next_permutation. It will be up to you to convince the Grand Inquisition Committee of Reviewers that next_even_permutation is necessary and/or sufficient. I don't like the

Re: immutable method not callable using argument types () - doesn't make sense

2012-10-09 Thread denizzzka
On Tuesday, 27 March 2012 at 12:57:18 UTC, bearophile wrote: Steven Schveighoffer: So what the compiler is saying is that you can't call dup with arguments (), you must call it with arguments '() immutable', meaning you must call it on an immutable B, not a mutable B. Any space for compiler

Re: next_permutation and cartesian product for ranges?

2012-10-09 Thread bearophile
Steven Schveighoffer: Is there any advantage over having a function? I'd think you could easily build a range based on the function, no? Generators (that yield lexicographic permutations, permutation swaps, combinations, etc) are quite more handy, you can compose them with the other ranges

Re: next_permutation and cartesian product for ranges?

2012-10-09 Thread H. S. Teoh
On Tue, Oct 09, 2012 at 11:24:27PM +0200, Timon Gehr wrote: [...] That's cute. =) flatten is in std.algorithm and is called joiner. Ahahahaha... I knew joiner existed; why didn't I think of it. :P Also, you need to be careful with index types. I'd suggest: import std.algorithm,

Re: next_permutation and cartesian product for ranges?

2012-10-09 Thread H. S. Teoh
On Tue, Oct 09, 2012 at 05:46:41PM -0400, Andrei Alexandrescu wrote: On 10/9/12 4:46 PM, H. S. Teoh wrote: On Tue, Oct 09, 2012 at 02:25:13PM -0400, Andrei Alexandrescu wrote: On 10/9/12 1:52 PM, H. S. Teoh wrote: [...] If there is any interest in next_permutation, I'd also like to propose a

Re: next_permutation and cartesian product for ranges?

2012-10-09 Thread ixid
On Tuesday, 9 October 2012 at 22:06:42 UTC, bearophile wrote: ixid: The naming scheme could do with... improvement. struct PermutationSwaps then? Bye, bearophile I think you're missing what I meant, naming a struct Sperm-utations seemed a bit unpleasant, I'm not actually bothered about

Re: next_permutation and cartesian product for ranges?

2012-10-09 Thread Timon Gehr
On 10/10/2012 01:13 AM, H. S. Teoh wrote: On Tue, Oct 09, 2012 at 11:24:27PM +0200, Timon Gehr wrote: [...] That's cute. =) flatten is in std.algorithm and is called joiner. Ahahahaha... I knew joiner existed; why didn't I think of it. :P Also, you need to be careful with index types. I'd

/usr/src/d/phobos/std/range.d(4590): Error: variable upper used before set

2012-10-09 Thread H. S. Teoh
Just wanted to bring to attention a compiler regression related to dmd -O: http://d.puremagic.com/issues/show_bug.cgi?id=8790 I think this warrants a fix ASAP. :) T -- Verbing weirds language. -- Calvin ( Hobbes)

Re: Windows DLLs and TLS

2012-10-09 Thread dnewbie
You can try compiling it with GDC! Please check this thread: http://forum.dlang.org/thread/nowjthaqnjfrcvqeu...@forum.dlang.org

std.algorithm.map + std.algorithm.joiner = broken forward range

2012-10-09 Thread H. S. Teoh
Code: import std.algorithm; import std.range; import std.stdio; void main() { auto x = [[1],[2],[3]]; auto yy = x.map!a.joiner; assert(isForwardRange!(typeof(yy))); writeln(yy.save); writeln(yy);

Re: Any interest in libgit bindings?

2012-10-09 Thread Jonathan M Davis
On Wednesday, October 10, 2012 00:46:28 Andrej Mitrovic wrote: But if there's any interest I could clean it up and make it a nice simple C wrapper just like the other deimos projects (https://github.com/D-Programming-Deimos). I think that it's safe to say that there would be definite value in

Re: /usr/src/d/phobos/std/range.d(4590): Error: variable upper used before set

2012-10-09 Thread Mehrdad
On Wednesday, 10 October 2012 at 01:07:37 UTC, H. S. Teoh wrote: Just wanted to bring to attention a compiler regression related to dmd -O: http://d.puremagic.com/issues/show_bug.cgi?id=8790 I think this warrants a fix ASAP. :) T Omg that bug looks... scary

Re: SQL working [ was Re: The sorry state of the D stack? ]

2012-10-09 Thread Jonathan M Davis
On Wednesday, October 10, 2012 00:02:50 Mark Lamberton wrote: I'm still not sure why (for example) Tango exists and what is its status relative to the D ecosystem. It's a historical thing. Phobos in D1 sucked (probably because Walter was focused on the compiler and I don't think that there

Re: /usr/src/d/phobos/std/range.d(4590): Error: variable upper used before set

2012-10-09 Thread Jonathan M Davis
On Wednesday, October 10, 2012 04:12:10 Mehrdad wrote: On Wednesday, 10 October 2012 at 01:07:37 UTC, H. S. Teoh wrote: Just wanted to bring to attention a compiler regression related to dmd -O: http://d.puremagic.com/issues/show_bug.cgi?id=8790 I think this warrants a fix ASAP. :)

Re: std.algorithm.map + std.algorithm.joiner = broken forward range

2012-10-09 Thread jerro
On Wednesday, 10 October 2012 at 02:11:49 UTC, H. S. Teoh wrote: Code: import std.algorithm; import std.range; import std.stdio; void main() { auto x = [[1],[2],[3]]; auto yy = x.map!a.joiner;

Re: std.algorithm.map + std.algorithm.joiner = broken forward range

2012-10-09 Thread H. S. Teoh
On Wed, Oct 10, 2012 at 05:00:00AM +0200, jerro wrote: On Wednesday, 10 October 2012 at 02:11:49 UTC, H. S. Teoh wrote: Code: import std.algorithm; import std.range; import std.stdio; void main() { auto x = [[1],[2],[3]]; auto yy = x.map!a.joiner;

Thoughts on tuple indexing syntax...

2012-10-09 Thread Chad J
From what I read on the DIP19: Remove comma operator... thread it sounded like one of the difficult challenges for tuples is ambiguities created by indexing tuple elements that might also be random access ranges (arrays). It gets especially nasty for single-element tuples. Would it help if

Re: Using inout in delegates

2012-10-09 Thread Jacob Carlborg
On 2012-10-08 21:40, Timon Gehr wrote: The original behaviour is to be expected and the workaround exploits a compiler bug. The correct way to get rid of the compile error is: void foo(inout(int)[] arr){ auto a = { const b = arr[0]; } // or int b = arr[0]; } Why can't auto work there?

Re: Struct polymorphism?

2012-10-09 Thread Jacob Carlborg
On 2012-10-09 00:19, Era Scarecrow wrote: I think this is a compiler bug. It complains about calling opDispatch, however it doesn't complain if you explicitly call 'this'. Should adding 'this' be required? I am using the -property switch so it's a little more strict, but that doesn't seem to

Re: Struct polymorphism?

2012-10-09 Thread Era Scarecrow
On Tuesday, 9 October 2012 at 06:53:54 UTC, Jacob Carlborg wrote: As far as I understand it, opDispatch needs a receiver, I.e. this.foo() or obj.foo(). I asked the same question a while ago and got that answer, it's by design. I've also tried adding a opDispatch in the same struct and the

Re: Remove element from DList

2012-10-09 Thread Steven Schveighoffer
On Sun, 07 Oct 2012 05:15:05 -0400, Jonathan M Davis jmdavisp...@gmx.com wrote: On Sunday, October 07, 2012 10:09:06 Russel Winder wrote: Removal from a singly-linked list can be O(1) as well, it depends whether you are deleting using an iterator in progress. IIRC that dcollections'

Re: bigger then size_t

2012-10-09 Thread Dmitry Olshansky
On 09-Oct-12 18:46, maarten van damme wrote: What happens when args[1].length is bigger then size_t? Can I detect this? Then size_t.max? It can't as it has type size_t. Equal or even close? Nope. As it there would not be enough of even _virtual_ memory to fit array of size_t.max and something

Re: Any sample for DFL library?

2012-10-09 Thread thedeemon
On Sunday, 7 October 2012 at 19:23:36 UTC, Lubos Pintes wrote: Does someone have any samples for DFL? Here's a recent project of mine which uses DFL: https://bitbucket.org/infognition/bsort/

not expected pointers for struct members from foreach

2012-10-09 Thread deed
import std.stdio; struct Test { static Test[] objects; static Test*[] psObject; static int[] ints; static int*[] psInt; int a; int b; int* pa; this(int a) { this.a = a; this.pa = this.a; this.b = 2 * a;

Re: bigger then size_t

2012-10-09 Thread Adam D. Ruppe
On Tuesday, 9 October 2012 at 15:56:15 UTC, maarten van damme wrote: Wouldn't a user then be able to launch that program followed by the contents of a big file of say 5 gig. The operating system won't allow that. There's a limit on argument sizes enforced before the program actually runs.

How can I know that all child thread are gone out?

2012-10-09 Thread Druzhinin Alexandr
Hello I spawn several threads and now I need to know if they has finished their job. Before I do it by means of messages from child threads to the main one to inform about finishing. But I'm sure this isn't good enough, because a child thread may fail before sending the exit message to the

Re: How can I know that all child thread are gone out?

2012-10-09 Thread Druzhinin Alexandr
On 09.10.2012 22:44, Druzhinin Alexandr wrote: Hello I spawn several threads and now I need to know if they has finished their job. Before I do it by means of messages from child threads to the main one to inform about finishing. But I'm sure this isn't good enough, because a child thread may

Re: not expected pointers for struct members from foreach

2012-10-09 Thread bearophile
deed: // Again, why are the three last adresses the same? The D language and its compiler is acting correctly here, so the output you see is correct. All those structs are allocated on the stack. The first three Test are allocated on the stack. In the loop it allocates the first

Re: bigger then size_t

2012-10-09 Thread maarten van damme
Ok, that solves it. Thank you.

Unexpected OPTLINK termination

2012-10-09 Thread Faux Amis
I get an unexpected OPTLINK termination when I run the lovely thing below, any advice (dmd 2.060)? rdmd --chatty --force --build-only ..\lib\libcairo-2.lib -I..\include ..\lib\libcairod.lib ..\lib\dmd_win32_x32.lib -version=Unicode -version=WIN32_WINNT_ONLY -version=WindowsNTonly

Re: bigger then size_t

2012-10-09 Thread maarten van damme
Another quick question. When I know an array is going to have an length smaller then 255, can I use bytes as index or do I have to use size_t to make it portable across 64 bit platforms?

this() in struct

2012-10-09 Thread Zhenya
Hi! I'm sorry,maybe this topic already was discussed,but could anybody explain me why default constructor was disallowed in structs?

Re: bigger then size_t

2012-10-09 Thread Dmitry Olshansky
On 09-Oct-12 20:36, maarten van damme wrote: Another quick question. When I know an array is going to have an length smaller then 255, can I use bytes as index or do I have to use size_t to make it portable across 64 bit platforms? The real question is why you need that? Byte is not faster

Re: this() in struct

2012-10-09 Thread Zhenya
On Tuesday, 9 October 2012 at 17:21:47 UTC, Zhenya wrote: Hi! I'm sorry,maybe this topic already was discussed,but could anybody explain me why default constructor was disallowed in structs? And if I have to do some initialization of data members,what is the way to do it?

Re: bigger then size_t

2012-10-09 Thread Dmitry Olshansky
On 09-Oct-12 19:35, Adam D. Ruppe wrote: On Tuesday, 9 October 2012 at 15:56:15 UTC, maarten van damme wrote: Wouldn't a user then be able to launch that program followed by the contents of a big file of say 5 gig. The operating system won't allow that. There's a limit on argument sizes

Error: function wgdb.to_string is not accessible from module wgdb

2012-10-09 Thread Charles Hixson
What does the following error mean? wgdb.d(24): Error: function wgdb.to_string is not accessible from module wgdb The function in question is the pretty simple: package string to_string(const char *zString) { int i; for (i = 0; zString[i] != 0; ++i) {}; return

Re: Remove element from DList

2012-10-09 Thread Jonathan M Davis
On Tuesday, October 09, 2012 10:29:46 Steven Schveighoffer wrote: dcollections does not have singly-linked lists. My mistake. I thought that you had said that it did in previous discussions on this topic. - Jonathan M Davis

Re: this() in struct

2012-10-09 Thread Maxim Fomin
On Tuesday, 9 October 2012 at 17:32:35 UTC, Zhenya wrote: On Tuesday, 9 October 2012 at 17:21:47 UTC, Zhenya wrote: Hi! I'm sorry,maybe this topic already was discussed,but could anybody explain me why default constructor was disallowed in structs? And if I have to do some initialization of

Re: this() in struct

2012-10-09 Thread Ali Çehreli
On 10/09/2012 10:08 AM, Zhenya wrote: On Tuesday, 9 October 2012 at 17:21:47 UTC, Zhenya wrote: Hi! I'm sorry,maybe this topic already was discussed,but could anybody explain me why default constructor was disallowed in structs? And if I have to do some initialization of data members,what is

Re: this() in struct

2012-10-09 Thread Jonathan M Davis
On Tuesday, October 09, 2012 19:08:35 Zhenya wrote: On Tuesday, 9 October 2012 at 17:21:47 UTC, Zhenya wrote: Hi! I'm sorry,maybe this topic already was discussed,but could anybody explain me why default constructor was disallowed in structs? And if I have to do some initialization of

Re: this() in struct

2012-10-09 Thread Zhenya
On Tuesday, 9 October 2012 at 18:29:18 UTC, Jonathan M Davis wrote: On Tuesday, October 09, 2012 19:08:35 Zhenya wrote: On Tuesday, 9 October 2012 at 17:21:47 UTC, Zhenya wrote: Hi! I'm sorry,maybe this topic already was discussed,but could anybody explain me why default constructor was

Re: this() in struct

2012-10-09 Thread H. S. Teoh
On Tue, Oct 09, 2012 at 07:08:35PM +0200, Zhenya wrote: On Tuesday, 9 October 2012 at 17:21:47 UTC, Zhenya wrote: Hi! I'm sorry,maybe this topic already was discussed,but could anybody explain me why default constructor was disallowed in structs? And if I have to do some initialization of

Re: Remove element from DList

2012-10-09 Thread Steven Schveighoffer
On Tue, 09 Oct 2012 13:51:09 -0400, Jonathan M Davis jmdavisp...@gmx.com wrote: On Tuesday, October 09, 2012 10:29:46 Steven Schveighoffer wrote: dcollections does not have singly-linked lists. My mistake. I thought that you had said that it did in previous discussions on this topic.

Re: this() in struct

2012-10-09 Thread Zhenya
On Tuesday, 9 October 2012 at 18:29:18 UTC, Jonathan M Davis wrote: On Tuesday, October 09, 2012 19:08:35 Zhenya wrote: On Tuesday, 9 October 2012 at 17:21:47 UTC, Zhenya wrote: Hi! I'm sorry,maybe this topic already was discussed,but could anybody explain me why default constructor was

Re: this() in struct

2012-10-09 Thread Jonathan M Davis
On Tuesday, October 09, 2012 20:09:56 Zhenya wrote: Ok.Then can I do my own .init property that can be executed in compile-time? No. You directly initialize the member variables to what you want them to be, and that's the values that they have in the init property. You can't have anything

Re: How can I know that all child thread are gone out?

2012-10-09 Thread Sean Kelly
On Oct 9, 2012, at 8:44 AM, Druzhinin Alexandr n...@digitalmars.com wrote: Hello I spawn several threads and now I need to know if they has finished their job. Before I do it by means of messages from child threads to the main one to inform about finishing. But I'm sure this isn't good

Re: this() in struct

2012-10-09 Thread Zhenya
On Tuesday, 9 October 2012 at 19:04:40 UTC, Jonathan M Davis wrote: On Tuesday, October 09, 2012 20:09:56 Zhenya wrote: Ok.Then can I do my own .init property that can be executed in compile-time? No. You directly initialize the member variables to what you want them to be, and that's the

Re: Unexpected OPTLINK termination

2012-10-09 Thread Andrei Alexandrescu
On 10/9/12 12:30 PM, Faux Amis wrote: On a side-note, why is rdmd picky about argument order? dmd test.d -I..\include Because anything after the program is considered an argument to the program. Andrei

  1   2   >