Re: CMake with D support early snapshot

2014-03-26 Thread Ben Boeckel
On Tue, Mar 25, 2014 at 14:12:45 -0400, Ben Boeckel wrote: I'll try it out when I get a chance. I've pushed some fixes to my CMake fork to work with GDC on Linux. I've also fixed up some things I saw and opened a bug on your fork (which isn't linked with Kitware/CMake, so PRs are unavailable…an

DFL can be used by D2.065

2014-03-26 Thread FrankLike
If you are programming on win32,now,DFL can be used by D2.065. Please git clone http://github.com/FrankLike/dfl Open the folder w32 -dflexe double click the 'makedflexe.bat' file,after some seconds ,press the 'Enter key' ,after some seconds,dfl.lib,dfl.exe are all in you d install

Re: Experimental win32 OMF linker written in D now on github

2014-03-26 Thread Steve Teale
On Tuesday, 25 March 2014 at 03:27:07 UTC, Jack Applegame wrote: Nifty! I love this Pro: - Usually produces working executables :) Me too. But not more than Written in D :) But the best is Not written before I was born :) When I was a lad we had to Steve

Re: DFL can be used by D2.065

2014-03-26 Thread Andrej Mitrovic
On 3/26/14, FrankLike 1150015...@qq.com wrote: If you are programming on win32,now,DFL can be used by D2.065. Please git clone http://github.com/FrankLike/dfl Open the folder w32 -dflexe double click the 'makedflexe.bat' FYI: you've changed one hardcoded path to another. I also don't

Re: Experimental win32 OMF linker written in D now on github

2014-03-26 Thread Daniel Murphy
Daniel Murphy wrote in message news:lgngea$1ccj$1...@digitalmars.com... So a couple of years ago I had too much free time and wrote a linker. It's now on github: https://github.com/yebblies/ylink Now updated with basic mscoff32 support - although dmd doesn't emit that file format, it does

Re: CMake with D support early snapshot

2014-03-26 Thread Trent Forkert
On Wednesday, 26 March 2014 at 06:17:57 UTC, Ben Boeckel wrote: On Tue, Mar 25, 2014 at 14:12:45 -0400, Ben Boeckel wrote: I'll try it out when I get a chance. I've pushed some fixes to my CMake fork to work with GDC on Linux. I've also fixed up some things I saw and opened a bug on your

Re: Experimental win32 OMF linker written in D now on github

2014-03-26 Thread Rikki Cattermole
On Wednesday, 26 March 2014 at 15:33:39 UTC, Daniel Murphy wrote: Daniel Murphy wrote in message news:lgngea$1ccj$1...@digitalmars.com... So a couple of years ago I had too much free time and wrote a linker. It's now on github: https://github.com/yebblies/ylink Now updated with basic

Re: CMake with D support early snapshot

2014-03-26 Thread Trent Forkert
I have a quandary you might be able to help with, Ben. I've been working on moving dependency resolution things to cmDependsD.cxx, and I've got it mostly working. However, if we have gdc produce make-style dependencies (which will still require processing to get CMake to be happy), that

Re: CMake with D support early snapshot

2014-03-26 Thread Ben Boeckel
On Wed, Mar 26, 2014 at 22:52:43 +, Trent Forkert wrote: However, if we have gdc produce make-style dependencies (which will still require processing to get CMake to be happy), that requires me to put a special case in the C++ that I'd rather not have. I'm fine with either, but make-style

Re: CMake with D support early snapshot

2014-03-26 Thread Trent Forkert
On Wednesday, 26 March 2014 at 23:17:31 UTC, Ben Boeckel wrote: What about: 4. Add depfile support to Makefile generators. That's basically what I'm doing, though only in the context of D. cmDependsD::WriteDependencies() gets called for every D object, and has the D compiler produce a

Re: CMake with D support early snapshot

2014-03-26 Thread Ben Boeckel
On Thu, Mar 27, 2014 at 00:38:05 +, Trent Forkert wrote: On Wednesday, 26 March 2014 at 23:17:31 UTC, Ben Boeckel wrote: 4. Add depfile support to Makefile generators. That's basically what I'm doing, though only in the context of D. No, I meant, using the DEPFLAGS during the make

D should have a Version migration tool

2014-03-26 Thread FrankLike
D has a lot of tools ,but not have a Version migration tool,that can help the old codes to migrate easily to the new dmd Version.

Re: CMake with D support early snapshot

2014-03-26 Thread Trent Forkert
On Thursday, 27 March 2014 at 01:16:57 UTC, Ben Boeckel wrote: On Thu, Mar 27, 2014 at 00:38:05 +, Trent Forkert wrote: On Wednesday, 26 March 2014 at 23:17:31 UTC, Ben Boeckel wrote: 4. Add depfile support to Makefile generators. That's basically what I'm doing, though only in the

Re: DFL can be used by D2.065

2014-03-26 Thread FrankLike
On Wednesday, 26 March 2014 at 10:42:09 UTC, Andrej Mitrovic wrote: On 3/26/14, FrankLike 1150015...@qq.com wrote: If you are programming on win32,now,DFL can be used by D2.065. Please git clone http://github.com/FrankLike/dfl Open the folder w32 -dflexe double click the 'makedflexe.bat'

Re: CMake with D support early snapshot

2014-03-26 Thread Ben Boeckel
On Thu, Mar 27, 2014 at 01:52:00 +, Trent Forkert wrote: I've tested this by creating a wrapper script around dmd to log calls to it in a file. Using that, I can confirm that cmDependsD does nothing at configure time. Granted it didn't refresh the deps file when I updated my D code, but...

Re: Experimental win32 OMF linker written in D now on github

2014-03-26 Thread Colden Cullen
On Wednesday, 26 March 2014 at 15:33:39 UTC, Daniel Murphy wrote: Now updated with basic mscoff32 support - although dmd doesn't emit that file format, it does mean you can link the standard import libraries into your normal D applications, instead of having to convert them to omf. This is a

Re: A nice idea to draw from

2014-03-26 Thread Asman01
On Wednesday, 26 March 2014 at 05:24:42 UTC, Andrei Alexandrescu wrote: http://cmr.github.io/blog/2014/03/24/this-week-in-rust/ They mention what happened, who's contributing, and such. Would love to see somebody in our community initiating something similar. Andrei I like the idea. We

Re: A nice idea to draw from

2014-03-26 Thread Asman01
On Wednesday, 26 March 2014 at 05:45:27 UTC, ed wrote: On Wednesday, 26 March 2014 at 05:24:42 UTC, Andrei Alexandrescu wrote: http://cmr.github.io/blog/2014/03/24/this-week-in-rust/ They mention what happened, who's contributing, and such. Would love to see somebody in our community

Re: DFL

2014-03-26 Thread FrankLike
On DFL Can work in D2.065 on win. Thanks Christopher E. Miller

Re: Unbuffered range interface

2014-03-26 Thread Vladimir Panteleev
On Wednesday, 26 March 2014 at 00:55:31 UTC, Andrei Alexandrescu wrote: The recent discussion initiated by Walter points to a problem known since a long time ago: ranges are well modeled by objects in memory (arrays, lists, other containers) but poorly by objects that need to load or construct

Re: A nice idea to draw from

2014-03-26 Thread w0rp
On Wednesday, 26 March 2014 at 05:24:42 UTC, Andrei Alexandrescu wrote: http://cmr.github.io/blog/2014/03/24/this-week-in-rust/ They mention what happened, who's contributing, and such. Would love to see somebody in our community initiating something similar. Andrei We could make a start

Re: Changing the behavior of the comma operator

2014-03-26 Thread Kagamin
On Tuesday, 25 March 2014 at 17:58:45 UTC, bearophile wrote: I think total removal of the comma operator could offer more readable D code. No, complete removal will make code less readable. Why can't you read commas?

Re: Should we deprecate comma?

2014-03-26 Thread Steve Teale
On Tuesday, 25 March 2014 at 13:15:17 UTC, Timon Gehr wrote: On 03/25/2014 02:08 PM, bearophile wrote: Steve Teale: The only place I have tended to use the comma operator is in ternary expressions bool universal; atq = whatever? 0: universal = true, 42; I classify that as quite tricky

Re: Should we deprecate comma?

2014-03-26 Thread Kagamin
On Tuesday, 25 March 2014 at 14:00:28 UTC, Byron wrote: On Sun, 23 Mar 2014 20:09:45 -0700, Andrei Alexandrescu wrote: That was in Phobos too. Fix: int a = something == 1 ? 1 : something == 2 ? 2 : { assert(0); return 0; }(); There are of course other ways, too, including defining a

Re: Should we deprecate comma?

2014-03-26 Thread Steve Teale
On Tuesday, 25 March 2014 at 13:08:59 UTC, bearophile wrote: Steve Teale: I classify that as quite tricky code, it's a negative example :-( Bye, bearophile I was not recommending it, I was just trying to think of when I'd used comma, and that popped into my head. Basically I agree that

Re: A nice idea to draw from

2014-03-26 Thread Rikki Cattermole
On Wednesday, 26 March 2014 at 07:45:56 UTC, w0rp wrote: On Wednesday, 26 March 2014 at 05:24:42 UTC, Andrei Alexandrescu wrote: http://cmr.github.io/blog/2014/03/24/this-week-in-rust/ They mention what happened, who's contributing, and such. Would love to see somebody in our community

Re: A nice idea to draw from

2014-03-26 Thread monarch_dodra
On Wednesday, 26 March 2014 at 08:46:07 UTC, Rikki Cattermole wrote: I would say we need to go a step further and ask who wants to be the marketing manager for the D community? From there is just needs somebody who is willing to write up e.g. pull requests summary. The marketing manager could

Re: Changing the behavior of the comma operator

2014-03-26 Thread Jason King
The proposed change would allow the code above, but not this: for (x=1, y=2; x++, x 10 y 20; y++) { ... } Andrei After the change in D this code would generate a warning/error? If that's so then the does the same as C code or fails to compile objective is still being met.

Re: Unbuffered range interface

2014-03-26 Thread Andrea Fontana
Similar scenario writing my mongodb (document based db) wrapper. On Wednesday, 26 March 2014 at 00:55:31 UTC, Andrei Alexandrescu wrote: The recent discussion initiated by Walter points to a problem known since a long time ago: ranges are well modeled by objects in memory (arrays, lists,

Re: Changing the behavior of the comma operator

2014-03-26 Thread simendsjo
On 03/26/2014 10:19 AM, Jason King wrote: The proposed change would allow the code above, but not this: for (x=1, y=2; x++, x 10 y 20; y++) { ... } Andrei After the change in D this code would generate a warning/error? If that's so then the does the same as C code or fails to compile

Re: Optimizing a raytracer

2014-03-26 Thread Róbert László Páli
Oh, thanks for all of your help. Nice to see, that D guys do really help. :)

Re: Optimizing a raytracer

2014-03-26 Thread Róbert László Páli
Using a double4 could improve the performance of your code, but it must be used wisely. (One general tip is to avoid mixing SIMD and serial code. if you want to use SIMD code, then it's often better to keep using SIMD registers even if you have one value). I sadly could not get it to work

Proper C Pointer Binding

2014-03-26 Thread Róbert László Páli
I am programming a new GUI widget library based on OpenGL for D. For that I manually bind the used OpenGL functions to D and create an abstraction layer to draw things, boxes, texts, shapes, etc. http://palaes.rudanium.org/HueApp/intro.php The thing compiles nicely with SDL, FreeType, FTGL. But

Re: Proper C Pointer Binding

2014-03-26 Thread R
void main() { // init screen and OpenGL setup auto font = loadFont(cast (char * ) Arial.TTF); scope (exit) destroyFont(font); // draw some text // close OpenGL and SDL with some second delay } Also I am not sure about the string casting to char * here. I have been told that

Re: protocol for using InputRanges

2014-03-26 Thread Regan Heath
On Tue, 25 Mar 2014 23:22:18 -, Walter Bright newshou...@digitalmars.com wrote: On 3/25/2014 2:29 PM, Andrei Alexandrescu wrote: The range instance gets bigger and more expensive to copy, and the cost of manipulating the flag and the buffer is added to every loop iteration. Note that the

Re: Proper C Pointer Binding

2014-03-26 Thread bearophile
R: void main() { // init screen and OpenGL setup auto font = loadFont(cast (char * ) Arial.TTF); scope (exit) destroyFont(font); // draw some text // close OpenGL and SDL with some second delay } Also I am not sure about the string casting to char * here. I have been told that

Re: Changing the behavior of the comma operator

2014-03-26 Thread Andrej Mitrovic
On 3/26/14, Kagamin s...@here.lot wrote: On Tuesday, 25 March 2014 at 17:58:45 UTC, bearophile wrote: I think total removal of the comma operator could offer more readable D code. No, complete removal will make code less readable. Why can't you read commas? Have you never experienced this

Re: Changing the behavior of the comma operator

2014-03-26 Thread bearophile
Andrej Mitrovic: Have you never experienced this bug before? enum vals = [ afoo01foo01, bbar02foo02, cdoo03foo03, dfoo01foo04, ebar02foo01, fdoo03foo02, gfoo01foo03, hbar02foo04, aidoo03foo01 jfoo01foo02a, kbar02foo03, ldoo03foo04, ]; Walter

Re: Proper C Pointer Binding

2014-03-26 Thread Mike Parker
On 3/26/2014 6:51 PM, Róbert László Páli wrote: I am programming a new GUI widget library based on OpenGL for D. For that I manually bind the used OpenGL functions to D and create an abstraction layer to draw things, boxes, texts, shapes, etc. http://palaes.rudanium.org/HueApp/intro.php The

Re: Changing the behavior of the comma operator

2014-03-26 Thread monarch_dodra
On Wednesday, 26 March 2014 at 11:08:45 UTC, Andrej Mitrovic wrote: On 3/26/14, Kagamin s...@here.lot wrote: On Tuesday, 25 March 2014 at 17:58:45 UTC, bearophile wrote: I think total removal of the comma operator could offer more readable D code. No, complete removal will make code less

Re: Proper C Pointer Binding

2014-03-26 Thread ralex
On Wednesday, 26 March 2014 at 09:51:04 UTC, Róbert László Páli wrote: I am programming a new GUI widget library based on OpenGL for D. For that I manually bind the used OpenGL functions to D and create an abstraction layer to draw things, boxes, texts, shapes, etc.

Re: Proper C Pointer Binding

2014-03-26 Thread ralex
static Font opCall(string path) { Font f; f.fptr = loadFont(path.toStringz()); return s; } That should be return f; of course.

Re: Changing the behavior of the comma operator

2014-03-26 Thread Marc Schütz
On Tuesday, 25 March 2014 at 19:25:43 UTC, ixid wrote: I think this should not be done. Note that even though code which is D could reintroduce commas safely, C code will still exist at that time, and likely need porting to D. The principle that C code should either do the same thing, or not

Re: Optimizing a raytracer

2014-03-26 Thread Bienlein
You can also achieve significant speed-ups by doing things in parallel, f.ex. see https://groups.google.com/forum/?hl=de#!searchin/golang-nuts/ray$20tracer/golang-nuts/mxYzHQSV3rw/dOA78aeVLgEJ

Re: protocol for using InputRanges

2014-03-26 Thread Steven Schveighoffer
On Wed, 26 Mar 2014 06:46:26 -0400, Regan Heath re...@netmail.co.nz wrote: On Tue, 25 Mar 2014 23:22:18 -, Walter Bright newshou...@digitalmars.com wrote: On 3/25/2014 2:29 PM, Andrei Alexandrescu wrote: The range instance gets bigger and more expensive to copy, and the cost of

Re: DIP 57: static foreach

2014-03-26 Thread bearophile
Timon Geh: http://wiki.dlang.org/DIP57/ Thoughts? Is it good to support this syntax too? static foreach (enum i; 0 .. 10) {} Bye, bearophile

Re: protocol for using InputRanges

2014-03-26 Thread Steven Schveighoffer
On Wed, 26 Mar 2014 08:29:15 -0400, Steven Schveighoffer schvei...@yahoo.com wrote: On Wed, 26 Mar 2014 06:46:26 -0400, Regan Heath re...@netmail.co.nz wrote: IMO the rules should be something like: - r.empty WILL return false if there is more data available in the range. - r.empty

Re: Changing the behavior of the comma operator

2014-03-26 Thread Kagamin
On Wednesday, 26 March 2014 at 10:54:44 UTC, bearophile wrote: When I read code quickly I sometimes mistake what's the what part of the expression returned. With this proposal an attempt to return the result of the comma operator won't compile.

Re: Changing the behavior of the comma operator

2014-03-26 Thread Kagamin
On Wednesday, 26 March 2014 at 11:08:45 UTC, Andrej Mitrovic wrote: Have you never experienced this bug before? enum vals = [ afoo01foo01, bbar02foo02, cdoo03foo03, dfoo01foo04, ebar02foo01, fdoo03foo02, gfoo01foo03, hbar02foo04, aidoo03foo01

Re: Changing the behavior of the comma operator

2014-03-26 Thread Steven Schveighoffer
On Wed, 26 Mar 2014 10:24:59 -0400, Kagamin s...@here.lot wrote: On Wednesday, 26 March 2014 at 11:08:45 UTC, Andrej Mitrovic wrote: Have you never experienced this bug before? enum vals = [ afoo01foo01, bbar02foo02, cdoo03foo03, dfoo01foo04, ebar02foo01, fdoo03foo02,

Re: Forcing weak-pure

2014-03-26 Thread Kagamin
On Tuesday, 25 March 2014 at 23:30:28 UTC, Artur Skawina wrote: It's ok to treat allocator and factory functions as pure, because those really are logically pure, ie can't affect any /visible/ state and return results that are unique. Allocators don't return unique results, GC being the

Interface D with other languages

2014-03-26 Thread Andrea Fontana
I know there are several tools around to import libraries from other languages. For example dstep or swig. Is there any tool that we can use to export D to other language? Something like SWIG but d-based rather than c/c++ based. Anyone? It would be great (for example) to @annotate

Re: Interface D with other languages

2014-03-26 Thread Andrea Fontana
On Wednesday, 26 March 2014 at 14:45:57 UTC, Andrea Fontana wrote: I know there are several tools around to import libraries from other languages. For example dstep or swig. Is there any tool that we can use to export D to other language? Something like SWIG but d-based rather than c/c++

Re: Changing the behavior of the comma operator

2014-03-26 Thread Kagamin
On Wednesday, 26 March 2014 at 14:39:11 UTC, Steven Schveighoffer wrote: Frequently, I have situations where I do not put a comma on the last element. Hehe, I don't use features which I can't afford (e.g. template black magic). Otherwise I won't be able to handle my own code.

Re: protocol for using InputRanges

2014-03-26 Thread Regan Heath
On Wed, 26 Mar 2014 12:30:53 -, Steven Schveighoffer schvei...@yahoo.com wrote: On Wed, 26 Mar 2014 08:29:15 -0400, Steven Schveighoffer schvei...@yahoo.com wrote: On Wed, 26 Mar 2014 06:46:26 -0400, Regan Heath re...@netmail.co.nz wrote: IMO the rules should be something like: -

Re: Interface D with other languages

2014-03-26 Thread JN
On Wednesday, 26 March 2014 at 14:45:57 UTC, Andrea Fontana wrote: I know there are several tools around to import libraries from other languages. For example dstep or swig. Is there any tool that we can use to export D to other language? Something like SWIG but d-based rather than c/c++

Re: fold: a replacement for reduce

2014-03-26 Thread Simen Kjærås
On 2014-03-25 21:16, Nordlöw wrote: You have no guarantees that you'll have stability of the returned type. What do you mean with stability of the return type? More often than not, it *is* stable, but there are cases where it is not. Could you gives examples of when it's stable and when

Re: fold: a replacement for reduce

2014-03-26 Thread monarch_dodra
On Wednesday, 26 March 2014 at 15:18:36 UTC, Simen Kjærås wrote: On 2014-03-25 21:16, Nordlöw wrote: You have no guarantees that you'll have stability of the returned type. What do you mean with stability of the return type? More often than not, it *is* stable, but there are cases where it

Re: Formal review of dtoh

2014-03-26 Thread Andrea Fontana
On Tuesday, 25 March 2014 at 20:38:40 UTC, Jacob Carlborg wrote: This is the formal review of Adam D. Ruppe's tool dtoh for inclusion in the tools repository [1]. Dtoh is a tool used to convert D modules to C/C++ headers. This allows to use D libraries in C/C++ code. This review might be a

Re: protocol for using InputRanges

2014-03-26 Thread Steven Schveighoffer
On Wed, 26 Mar 2014 11:09:04 -0400, Regan Heath re...@netmail.co.nz wrote: On Wed, 26 Mar 2014 12:30:53 -, Steven Schveighoffer schvei...@yahoo.com wrote: Gah, I didn't cut out the right rules. I meant the two rules that empty must be called before others. Those are not necessary.

Re: Optimizing a raytracer

2014-03-26 Thread Róbert László Páli
Thanks! I already do tracing the samples parallel. Strangly I have a core 2 duo and it seems that using 3 threads is the best (slightly better than 2). Aldough this might be accidetal. Maybe the more-complex samples are more equally in separate threds.

Re: Changing the behavior of the comma operator

2014-03-26 Thread H. S. Teoh
On Wed, Mar 26, 2014 at 08:24:23AM +, Kagamin wrote: On Tuesday, 25 March 2014 at 17:58:45 UTC, bearophile wrote: I think total removal of the comma operator could offer more readable D code. No, complete removal will make code less readable. Why can't you read commas? Are you talking

Re: protocol for using InputRanges

2014-03-26 Thread monarch_dodra
On Wednesday, 26 March 2014 at 15:37:38 UTC, Steven Schveighoffer wrote: Yes, but when you know that empty is going to return false, there isn't any logical reason to call it. It is an awkward requirement. -Steve Not only that, but it's also a performance criteria: If you are iterating on

Re: protocol for using InputRanges

2014-03-26 Thread Regan Heath
On Wed, 26 Mar 2014 15:37:38 -, Steven Schveighoffer schvei...@yahoo.com wrote: On Wed, 26 Mar 2014 11:09:04 -0400, Regan Heath re...@netmail.co.nz wrote: On Wed, 26 Mar 2014 12:30:53 -, Steven Schveighoffer schvei...@yahoo.com wrote: Gah, I didn't cut out the right rules. I

Re: protocol for using InputRanges

2014-03-26 Thread Regan Heath
On Wed, 26 Mar 2014 16:38:57 -, monarch_dodra monarchdo...@gmail.com wrote: On Wednesday, 26 March 2014 at 15:37:38 UTC, Steven Schveighoffer wrote: Yes, but when you know that empty is going to return false, there isn't any logical reason to call it. It is an awkward requirement.

How to create a deep copy of an associative array from within a pure function?

2014-03-26 Thread dnspies
I can't figure out how to copy an associative array from inside a pure function. import std.stdio; import std.variant; void main() { immutable Variant[string] nested_map = [This:mv([is:mv(),a:mv()]), nested:mv([map:mv()])];

Re: Challenge: write a really really small front() for UTF8

2014-03-26 Thread Temtaime
http://goo.gl/4RSWhr Only 3 ifs.

Re: Changing the behavior of the comma operator

2014-03-26 Thread Andrei Alexandrescu
On 3/26/14, 7:39 AM, Steven Schveighoffer wrote: On Wed, 26 Mar 2014 10:24:59 -0400, Kagamin s...@here.lot wrote: On Wednesday, 26 March 2014 at 11:08:45 UTC, Andrej Mitrovic wrote: Have you never experienced this bug before? enum vals = [ afoo01foo01, bbar02foo02, cdoo03foo03,

Re: Changing the behavior of the comma operator

2014-03-26 Thread monarch_dodra
On Wednesday, 26 March 2014 at 17:27:16 UTC, Andrei Alexandrescu wrote: Big mistake :o). -- Andrei Yeah, how are we doing on that front? Have any decisions actually been made?

Re: protocol for using InputRanges

2014-03-26 Thread monarch_dodra
On Wednesday, 26 March 2014 at 16:55:48 UTC, Regan Heath wrote: On Wed, 26 Mar 2014 16:38:57 -, monarch_dodra Not only that, but it's also a performance criteria: If you are iterating on two ranges at once (think copy), then you *know* range2 is longer than range1, even if you don't know

Re: protocol for using InputRanges

2014-03-26 Thread Andrei Alexandrescu
On 3/26/14, 8:37 AM, Steven Schveighoffer wrote: On Wed, 26 Mar 2014 11:09:04 -0400, Regan Heath re...@netmail.co.nz wrote: On Wed, 26 Mar 2014 12:30:53 -, Steven Schveighoffer schvei...@yahoo.com wrote: Gah, I didn't cut out the right rules. I meant the two rules that empty must be

Re: Changing the behavior of the comma operator

2014-03-26 Thread Andrei Alexandrescu
On 3/26/14, 10:34 AM, monarch_dodra wrote: On Wednesday, 26 March 2014 at 17:27:16 UTC, Andrei Alexandrescu wrote: Big mistake :o). -- Andrei Yeah, how are we doing on that front? Have any decisions actually been made? What front?

Re: Changing the behavior of the comma operator

2014-03-26 Thread monarch_dodra
On Wednesday, 26 March 2014 at 17:40:36 UTC, Andrei Alexandrescu wrote: On 3/26/14, 10:34 AM, monarch_dodra wrote: On Wednesday, 26 March 2014 at 17:27:16 UTC, Andrei Alexandrescu wrote: Big mistake :o). -- Andrei Yeah, how are we doing on that front? Have any decisions actually been made?

Re: Changing the behavior of the comma operator

2014-03-26 Thread Andrei Alexandrescu
On 3/26/14, 10:51 AM, monarch_dodra wrote: On Wednesday, 26 March 2014 at 17:40:36 UTC, Andrei Alexandrescu wrote: On 3/26/14, 10:34 AM, monarch_dodra wrote: On Wednesday, 26 March 2014 at 17:27:16 UTC, Andrei Alexandrescu wrote: Big mistake :o). -- Andrei Yeah, how are we doing on that

Re: protocol for using InputRanges

2014-03-26 Thread Ola Fosheim Grøstad
On Wednesday, 26 March 2014 at 17:36:08 UTC, Andrei Alexandrescu wrote: I think requiring users to call empty before front on input ranges is a concession we should make. Then the name should change to ready. It makes sense to require the user to check that the range is ready, but not to

Re: protocol for using InputRanges

2014-03-26 Thread Regan Heath
On Wed, 26 Mar 2014 17:32:30 -, monarch_dodra monarchdo...@gmail.com wrote: On Wednesday, 26 March 2014 at 16:55:48 UTC, Regan Heath wrote: On Wed, 26 Mar 2014 16:38:57 -, monarch_dodra Not only that, but it's also a performance criteria: If you are iterating on two ranges at once

Re: Challenge: write a really really small front() for UTF8

2014-03-26 Thread Temtaime
Oups, in last return forgot + s[3]

Re: Changing the behavior of the comma operator

2014-03-26 Thread bearophile
Andrei Alexandrescu: I personally use the implicit concatenation on occasion and it doesn't trip me, but I wouldn't mind adding a ~. While it's not a very common bug, it has tripped me few times. This is where I raised the issue in 2010: https://d.puremagic.com/issues/show_bug.cgi?id=3827

Re: Forcing weak-pure

2014-03-26 Thread Artur Skawina
On 03/26/14 15:36, Kagamin wrote: On Tuesday, 25 March 2014 at 23:30:28 UTC, Artur Skawina wrote: It's ok to treat allocator and factory functions as pure, because those really are logically pure, ie can't affect any /visible/ state and return results that are unique. Allocators don't

Re: Lazy mixins

2014-03-26 Thread Frustrated
On Wednesday, 26 March 2014 at 04:05:10 UTC, Philippe Sigaud wrote: No, I think I mentioned that string mixins can't get the context they are inserted in. Why would I simply wrap a string mixin around a template mixin if there wasn't some purpose that string mixins couldn't use in the first

Re: Bug in mixins?

2014-03-26 Thread Artur Skawina
On 03/07/14 20:22, Frustrated wrote: On Friday, 7 March 2014 at 09:10:45 UTC, John Colvin wrote: functions introduced through mixin templates do not take part in overload resolution when an overload exists outside the mixin. It's a common annoyance, I can't remember if there's a good reason

Re: Formal review of dtoh

2014-03-26 Thread Jacob Carlborg
On 2014-03-26 16:33, Andrea Fontana wrote: At least it shouldn't give error if called without any params but give some info :) Is there any usage example? Not that I have seen. Perhaps we should require some documentation. -- /Jacob Carlborg

Re: Changing the behavior of the comma operator

2014-03-26 Thread Andrei Alexandrescu
On 3/26/14, 11:36 AM, bearophile wrote: Fixing a little design mistake that causes bugs is not stopping all the other people like you from thinking about the more significant issues like concurrency, parallelism, reference scope, synchronized, and so on. Doesn't seem like it. From where I

Re: Changing the behavior of the comma operator

2014-03-26 Thread bearophile
Andrei Alexandrescu: I'd much rather make non-breaking improvements to the language, as there are plenty of opportunities. Three improvements I'd like for D: - A not ugly and handy syntax for tuples; - Optionally strongly typed array indexes; - enum preconditions or something similar. The

Re: Changing the behavior of the comma operator

2014-03-26 Thread w0rp
On Wednesday, 26 March 2014 at 11:08:45 UTC, Andrej Mitrovic wrote: On 3/26/14, Kagamin s...@here.lot wrote: On Tuesday, 25 March 2014 at 17:58:45 UTC, bearophile wrote: I think total removal of the comma operator could offer more readable D code. No, complete removal will make code less

Re: fold: a replacement for reduce

2014-03-26 Thread Nordlöw
a is of type double, b is of type idouble. When you consume the next element, the result would be double again, and it oscillates like that. I guess the return is CommonType!(double,idouble) in that case, right? Is that so hard to figure out...Hmm, there seems to be a limitation in D's

Re: Changing the behavior of the comma operator

2014-03-26 Thread Nick Sabalausky
On 3/26/2014 7:44 AM, Marc Schütz schue...@gmx.net wrote: On Tuesday, 25 March 2014 at 19:25:43 UTC, ixid wrote: I think this should not be done. Note that even though code which is D could reintroduce commas safely, C code will still exist at that time, and likely need porting to D. The

Re: Changing the behavior of the comma operator

2014-03-26 Thread Timon Gehr
On 03/26/2014 05:19 PM, H. S. Teoh wrote: int x = 1, 5; // hands up, how many understand what this does? Nothing. This fails to parse because at that place ',' is expected to be a separator for declarators.

Re: Changing the behavior of the comma operator

2014-03-26 Thread Timon Gehr
On 03/26/2014 08:49 PM, Andrei Alexandrescu wrote: I don't agree. It's much better to fix the little breaking changes now, and think about non-breaking improvements later. Because later the breaking changes will become less and less possible. That later is already now. So how come there

Re: DIP 57: static foreach

2014-03-26 Thread Timon Gehr
On 03/26/2014 01:33 PM, bearophile wrote: Timon Geh: http://wiki.dlang.org/DIP57/ Thoughts? Is it good to support this syntax too? static foreach (enum i; 0 .. 10) {} Bye, bearophile Yes, I think so. I'll try to finish the DIP this weekend.

Re: A nice idea to draw from

2014-03-26 Thread Rikki Cattermole
On Wednesday, 26 March 2014 at 08:59:24 UTC, monarch_dodra wrote: On Wednesday, 26 March 2014 at 08:46:07 UTC, Rikki Cattermole wrote: I would say we need to go a step further and ask who wants to be the marketing manager for the D community? From there is just needs somebody who is willing to

Re: Changing the behavior of the comma operator

2014-03-26 Thread Andrei Alexandrescu
On 3/26/14, 3:13 PM, Timon Gehr wrote: On 03/26/2014 08:49 PM, Andrei Alexandrescu wrote: I don't agree. It's much better to fix the little breaking changes now, and think about non-breaking improvements later. Because later the breaking changes will become less and less possible. That later

Re: A nice idea to draw from

2014-03-26 Thread Meta
On Wednesday, 26 March 2014 at 05:24:42 UTC, Andrei Alexandrescu wrote: http://cmr.github.io/blog/2014/03/24/this-week-in-rust/ They mention what happened, who's contributing, and such. Would love to see somebody in our community initiating something similar. Andrei This is somewhat

Re: Changing the behavior of the comma operator

2014-03-26 Thread deadalnix
On Wednesday, 26 March 2014 at 23:00:29 UTC, Andrei Alexandrescu wrote: On 3/26/14, 3:13 PM, Timon Gehr wrote: On 03/26/2014 08:49 PM, Andrei Alexandrescu wrote: I don't agree. It's much better to fix the little breaking changes now, and think about non-breaking improvements later. Because

Re: A nice idea to draw from

2014-03-26 Thread Andrei Alexandrescu
On 3/26/14, 4:53 PM, Meta wrote: On Wednesday, 26 March 2014 at 05:24:42 UTC, Andrei Alexandrescu wrote: http://cmr.github.io/blog/2014/03/24/this-week-in-rust/ They mention what happened, who's contributing, and such. Would love to see somebody in our community initiating something similar.

Re: DFL

2014-03-26 Thread FrankLike
On Wednesday, 26 March 2014 at 06:39:58 UTC, FrankLike wrote: DFL Can work in D2.065 on win. We can find it in http://github.com/FrankLIKE/dfl you can get it by git clone http://github.com/FrankLIKE/dfl Thanks Christopher E. Miller

Re: Building DFL

2014-03-26 Thread FrankLike
DFL CAN USING D2.065 FOR WIN You can get it by git clone http://github.com/FrankLIKE Christopher E. Miller,thank you.

Re: Changing the behavior of the comma operator

2014-03-26 Thread Steven Schveighoffer
On Wed, 26 Mar 2014 17:32:00 -0400, Nick Sabalausky seewebsitetocontac...@semitwist.com wrote: On 3/26/2014 7:44 AM, Marc Schütz schue...@gmx.net wrote: This is valid in both C and C++: i, j = 0, 1; It is equivalent to the following: i; j = 0; 1; Under the proposal, the 0,

Re: fold: a replacement for reduce

2014-03-26 Thread Jakob Ovrum
On Tuesday, 25 March 2014 at 17:22:45 UTC, monarch_dodra wrote: I think this is wrong. popping an empty range is an *Error*, and should be validated by the programmer. Because of this, it is currently not possible to use reduce(range) in nothrow context. Popping an empty range is indeed an

Re: Changing the behavior of the comma operator

2014-03-26 Thread Steven Schveighoffer
On Wed, 26 Mar 2014 13:27:17 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 3/26/14, 7:39 AM, Steven Schveighoffer wrote: Frequently, I have situations where I do not put a comma on the last element. Big mistake :o). -- Andrei A trailing comma in a list looks so

  1   2   >