Re: Passing large or complex data structures to threads

2013-05-28 Thread Joseph Rushton Wakeling
On 05/28/2013 08:56 AM, Ali Çehreli wrote: That is a difficult situation to manage though: What operations are valid under the 8 total mutable combinations of 3 members? The compiler must know what operations to be applied on what type of data so that it can both check the code and compile

Re: Failed to sort range

2013-05-28 Thread Sergei Nosov
On Tuesday, 28 May 2013 at 12:57:12 UTC, Sergei Nosov wrote: Hi! I'm trying to implement an array, which uses malloc to allocate memory. Also, I want to implement a random access range interface for it. That went pretty well, until I tried to sort it. Sorting function asserted Failed to

Re: Failed to sort range

2013-05-28 Thread bearophile
Sergei Nosov: That went pretty well, until I tried to sort it. Sorting function asserted Failed to sort range of type Array!(int). If you take a look a the implementation of Phobos sort, you see there is a recently added runtime test mostly meant to catch wrongly implemented comparison

Re: Failed to sort range

2013-05-28 Thread Sergei Nosov
On Tuesday, 28 May 2013 at 13:41:19 UTC, bearophile wrote: Sergei Nosov: That went pretty well, until I tried to sort it. Sorting function asserted Failed to sort range of type Array!(int). If you take a look a the implementation of Phobos sort, you see there is a recently added runtime

Re: Why does this snippet print the enum identifiers instead of their values?

2013-05-28 Thread Jesse Phillips
I do not believe this is a bug. You should be able to print the value by casting to string. (to!() will not work as it will provide the same results) Usually enumeration values are not descriptive for how they should be used. And when printing to the screen it is usually for debugging or

Re: Why does this snippet print the enum identifiers instead of their values?

2013-05-28 Thread bearophile
On Tuesday, 28 May 2013 at 14:35:22 UTC, Jesse Phillips wrote: I do not believe this is a bug. You are right, I was wrong. writeln is meant to write the name of enums and not their contents. Bye, bearophile

Re: Failed to sort range

2013-05-28 Thread Ali Çehreli
On 05/28/2013 05:57 AM, Sergei Nosov wrote: Hi! I'm trying to implement an array, which uses malloc to allocate memory. Also, I want to implement a random access range interface for it. That went pretty well, until I tried to sort it. Sorting function asserted Failed to sort range of type

Re: iteration over a string

2013-05-28 Thread Jonathan M Davis
On Tuesday, May 28, 2013 03:05:52 Timothee Cour wrote: 2A) Thanks for your answer; You skipped over this one, which I don't understand: string a=ΩΩab; auto b1=a.map!(a=d~a~d).array; writeln(b1);//[Ω, Ω, a, b, , ] Why are there 2 empty strings at the end? (one per Omega if you vary the

Re: iteration over a string

2013-05-28 Thread bearophile
Timothee Cour: Where do you think it can cause clashing? I don't know. But my solution is to introduce a simple enumerate range: http://d.puremagic.com/issues/show_bug.cgi?id=5550 So if you have a range and you don't need indexes you use: foreach (item; myrange) {} If you also want an

Re: Failed to sort range

2013-05-28 Thread Sergei Nosov
Thx, Ali! 1) First, an observation: This Array design conflates the concepts of container and range. If there are actual elements that are being stored (as opposed to elements being generated), it is better tha a range merely provides access to those elements. popFront should consume the

Re: Failed to sort range

2013-05-28 Thread Ali Çehreli
On 05/28/2013 11:19 AM, Sergei Nosov wrote: Do you mean it's a good idea to separate storage and access (via range) to the container? Like std.container's containers (heh) have nested Range struct? Yes, that is generally the right approach. Note that built-in arrays have a similar design

Re: Failed to sort range

2013-05-28 Thread Ali Çehreli
On 05/28/2013 11:31 AM, Ali Çehreli wrote: @property Array!T opSlice(size_t i, size_t j) { // ... ret.front_ = i; I feel like the initialization of front_ above is not right either. Imagine quick sort where we are slicing the right-hand side of a range as [0..10],

Re: Failed to sort range

2013-05-28 Thread Sergei Nosov
On Tuesday, 28 May 2013 at 18:38:01 UTC, Ali Çehreli wrote: On 05/28/2013 11:31 AM, Ali Çehreli wrote: @property Array!T opSlice(size_t i, size_t j) { // ... ret.front_ = i; I feel like the initialization of front_ above is not right either. Imagine quick sort where

Re: Failed to sort range

2013-05-28 Thread Anthony Goins
On Tuesday, 28 May 2013 at 12:57:12 UTC, Sergei Nosov wrote: Hi! I'm trying to implement an array, which uses malloc to allocate memory. Also, I want to implement a random access range interface for it. That went pretty well, until I tried to sort it. Sorting function asserted Failed to

Re: Failed to sort range

2013-05-28 Thread Ali Çehreli
On 05/28/2013 12:47 PM, Anthony Goins wrote: sort!(ab, SwapStrategy.stable)(arr); This worked for me with the code at your link. I've noticed that too. The reason that works is because in that case it uses Tim Sort. Apparently, the Tim Sort algorithm does not expose the bugs that were in

Re: iteration over a string

2013-05-28 Thread Timothee Cour
Thanks for the enumerate pointer. 3A) why not having an Enumerate(R) containing a single 'opApply' public method, to avoid returning tuples in 'front()' 3B) requiring one to use 'myrange.enumerate' for inputRanges and 'myrange' in other cases is bad for generic programming and user time. This is

Where does the log get written when there's a core dump?

2013-05-28 Thread Gary Willoughby
I was trying some funky stuff with D, not real code just playing and I got a message of a seg fault and a core dump written to a log. I just wondered where these logs are written to. It's not immediately apparent where it is.

Re: Where does the log get written when there's a core dump?

2013-05-28 Thread Adam D. Ruppe
On Tuesday, 28 May 2013 at 21:06:14 UTC, Gary Willoughby wrote: playing and I got a message of a seg fault and a core dump written to a log. like this? Segmentation fault (core dumped) That's actually more of a linux thing than a D thing. The file will be called core in the current

Re: iteration over a string

2013-05-28 Thread bearophile
Timothee Cour: 3A) why not having an Enumerate(R) containing a single 'opApply' public method, Unfortunately opApply doesn't not work well with all the other range-based functions. Also that Enumerate code is for illustrative purposes, it's not meant to be good library code. 3B)

Re: Immutability vs reference types

2013-05-28 Thread Ali Çehreli
On 05/27/2013 05:24 PM, Francois Chabot wrote: If with immutable(Type)[], I can have a re-assignable reference to arrays of immutable data, I really should be able to have some form of syntactical equivalent for single instances. But there just doesn't seem to be one. Immutability for

direct conversion to integral type for floor, ceil, and friends that return integer as real

2013-05-28 Thread Timothee Cour
What's the most efficient way to convert a float/double/real to an integer type with a specified rounding scheme (eg floor/ceil etc)? Is there anything besides: int x=floor(1.2); ? there's also core.stdc.math.floor{l,f,} Because these first convert to floating point representation and then then

Re: Linker error

2013-05-28 Thread Namespace
This is still there with the new release of 2.063. [quote] OPTLINK (R) for Win32 Release 8.00.12 Copyright (C) Digital Mars 1989-2010 All rights reserved. http://www.digitalmars.com/ctg/optlink.html Graphics.lib(object) Offset 201F6H Record Type 0091 Error 1: Previous Definition Different :

Re: Linker error

2013-05-28 Thread Namespace
I don't even understand the error. Where is a previous definition? And why? Seems like I have to switch back to 2.062.

Re: Failed to sort range

2013-05-28 Thread Sergei Nosov
On Tuesday, 28 May 2013 at 20:43:32 UTC, Ali Çehreli wrote: On 05/28/2013 12:47 PM, Anthony Goins wrote: sort!(ab, SwapStrategy.stable)(arr); This worked for me with the code at your link. I've noticed that too. The reason that works is because in that case it uses Tim Sort. Apparently,

Is this a compiler bug, or a breaking fix/enhancement?

2013-05-28 Thread estew
Hi All, I updated to dmd 2.063 today and all has been going smoothly until I decided to try out msgpack.d. I got an error compiling the msgpack.d unittest, so out of interest I decided to check this using dmd2.062 and it compiled and ran fine. I admit I don't really understand whether the

Re: Is this a compiler bug, or a breaking fix/enhancement?

2013-05-28 Thread estew
Here's a link to the msgpack.d source: https://github.com/msgpack/msgpack-d/blob/master/src/msgpack.d And the error is on line 3211, not 3215 as mentioned in the previous post. Thanks, Stewart

Re: Linker error

2013-05-28 Thread alex
On Tuesday, 28 May 2013 at 22:28:50 UTC, Namespace wrote: I don't even understand the error. Where is a previous definition? And why? Seems like I have to switch back to 2.062. In the case of using Mono-D, could you give me your build log please? That might help! When copypasting the

[Issue 10187] New: Precision of floating-point returned values

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10187 Summary: Precision of floating-point returned values Product: D Version: D2 Platform: x86 OS/Version: All Status: NEW Severity: normal Priority: P2

[Issue 10187] Precision of floating-point returned values

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10187 Maxim Fomin ma...@maxim-fomin.ru changed: What|Removed |Added CC||ma...@maxim-fomin.ru

[Issue 10187] Precision of floating-point returned values

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10187 Vladimir Panteleev thecybersha...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 8476] float comparison operand not truncated from real

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8476 Vladimir Panteleev thecybersha...@gmail.com changed: What|Removed |Added CC|

[Issue 10167] Wrong Document Comment on std.format.d(181)

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10167 --- Comment #3 from Ryuichi OHORI r.97...@gmail.com 2013-05-28 01:16:28 PDT --- I found that line 176 of std.format.d is wrong: $(TR $(TD $(B '#')) $(TD numeric ($(B '0'))) $(TD Use leading and thought it should be: $(TR $(TD $(B '0')) $(TD

[Issue 10188] New: Wrong Document Comment on std.format.d(176)

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10188 Summary: Wrong Document Comment on std.format.d(176) Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2

[Issue 10189] New: demangle doesn't work with __ModuleInfoZ __initZ __arrayZ

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10189 Summary: demangle doesn't work with __ModuleInfoZ __initZ __arrayZ Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal

[Issue 10190] New: fullyQualifiedName on enum template members doesn't work

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10190 Summary: fullyQualifiedName on enum template members doesn't work Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal

[Issue 10190] fullyQualifiedName on enum template members doesn't work

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10190 Dicebot m.stras...@gmail.com changed: What|Removed |Added CC||m.stras...@gmail.com

[Issue 10190] fullyQualifiedName on enum template members doesn't work

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10190 --- Comment #2 from Dicebot m.stras...@gmail.com 2013-05-28 02:38:03 PDT --- Ok, there are two issues here. First one is that identifier trait fails badly with temporaries, minimal example: template

[Issue 9878] std.algorithm.cartesianProduct results order

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9878 --- Comment #3 from bearophile_h...@eml.cc 2013-05-28 02:56:25 PDT --- (In reply to comment #2) where I suggest to give a template parameter to specify lexicographic/antilexicographic, along with depth first/breadth first. If you want to

[Issue 10191] New: std.array.array and Unicode strings

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10191 Summary: std.array.array and Unicode strings Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Severity: normal Priority: P2

[Issue 6447] iota(BigInt) too

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6447 Russel Winder rus...@winder.org.uk changed: What|Removed |Added CC|

[Issue 6447] iota(BigInt) too

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6447 --- Comment #3 from bearophile_h...@eml.cc 2013-05-28 04:15:16 PDT --- (In reply to comment #2) Is this a symptom of the fact that Phobos is really predicated on use of hardware types more generally? I think it's mostly a symptom of

[Issue 10192] New: Fixed size array initialization inconsistency between DeclDefs scope and statement scope

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10192 Summary: Fixed size array initialization inconsistency between DeclDefs scope and statement scope Product: D Version: D2 Platform: x86 OS/Version: Windows Status:

[Issue 3849] Compiler should catch incomplete initialisation of an array

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3849 --- Comment #20 from bearophile_h...@eml.cc 2013-05-28 04:45:25 PDT --- A small example why enforcing array lengths match improves safety of D programs. This part of a program uses strings to define a binary decision table, but it's easy to

[Issue 10193] New: Template args to UDA's

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10193 Summary: Template args to UDA's Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2 Component: DMD

[Issue 10017] Can not assign to a Variant another Variant holding a bigger structure

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10017 Martin Nowak c...@dawg.eu changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 10194] New: std.variant.Variant doesn't call the dtor of struct values

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10194 Summary: std.variant.Variant doesn't call the dtor of struct values Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal

[Issue 10193] Template args to UDA's

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10193 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 9816] Export is mostly broken

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=9816 --- Comment #4 from Martin Nowak c...@dawg.eu 2013-05-28 09:31:31 PDT --- 1) Exporting a global variable leads to a linker error fixed by bug 10059 2) Exporting thread local variables should be an error (at least it is in c++) Can't you

[Issue 10195] auto type inference on method override

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10195 Andrej Mitrovic andrej.mitrov...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 10195] New: auto type inference on method override

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10195 Summary: auto type inference on method override Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component:

[Issue 8318] Cannot override a method with inferred return type

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8318 Andrej Mitrovic andrej.mitrov...@gmail.com changed: What|Removed |Added CC|

[Issue 10021] auto return type and covariance

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10021 Sebastian Graf sebastiang...@t-online.de changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 8318] Cannot override a method with inferred return type

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8318 --- Comment #2 from Sebastian Graf sebastiang...@t-online.de 2013-05-28 14:01:45 PDT --- *** Issue 10021 has been marked as a duplicate of this issue. *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ---

[Issue 6101] Documentation for dead modules still distributed with DMD

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6101 Andrei Alexandrescu and...@erdani.com changed: What|Removed |Added CC|

[Issue 10196] New: RDMD: RDMD can't be used from MSys

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10196 Summary: RDMD: RDMD can't be used from MSys Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD

[Issue 10196] RDMD: RDMD can't be used from MSys

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10196 --- Comment #1 from Andrej Mitrovic andrej.mitrov...@gmail.com 2013-05-28 15:30:23 PDT --- Almost forgot, here's the -chatty version: - $ rdmd --chatty test.d stat C:/Users/ADMINI~1/AppData/Local/Temp\.rdmd stat

[Issue 6101] Documentation for dead modules still distributed with DMD

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6101 --- Comment #5 from Andrej Mitrovic andrej.mitrov...@gmail.com 2013-05-28 15:31:34 PDT --- We don't have access to HTML generation, it's always up to Walter to build the final zip file. -- Configure issuemail:

[Issue 6101] Documentation for dead modules still distributed with DMD

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6101 Andrei Alexandrescu and...@erdani.com changed: What|Removed |Added Status|REOPENED|ASSIGNED

[Issue 10193] Template args to UDA's

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10193 Manu turkey...@gmail.com changed: What|Removed |Added Status|RESOLVED|REOPENED

[Issue 10167] Wrong Document Comment on std.format.d(181)

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10167 --- Comment #4 from github-bugzi...@puremagic.com 2013-05-28 17:53:02 PDT --- Commit pushed to https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/d6488d76a8dfcb2ef6d2cd094cfaeb13f4df9e69

[Issue 10193] Template args to UDA's

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10193 Diggory digg...@googlemail.com changed: What|Removed |Added CC||digg...@googlemail.com

[Issue 10188] Wrong Document Comment on std.format.d(176)

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10188 --- Comment #1 from github-bugzi...@puremagic.com 2013-05-28 21:50:26 PDT --- Commit pushed to master at https://github.com/D-Programming-Language/phobos

[Issue 10188] Wrong Document Comment on std.format.d(176)

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10188 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Keywords||pull

[Issue 10193] Template args to UDA's

2013-05-28 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=10193 --- Comment #4 from Manu turkey...@gmail.com 2013-05-28 22:10:42 PDT --- (In reply to comment #3) It could be implemented by making the template rewrite rule happen before the attribute rewrite rule, so that this: @attribute(target, T)

<    1   2   3