Re: Very short article with with manual memory management in C++ and D.

2013-02-07 Thread Paulo Pinto
On Wednesday, 6 February 2013 at 21:35:12 UTC, MattCoder wrote: On Wednesday, 6 February 2013 at 13:16:45 UTC, Paulo Pinto wrote: I just wanted to show that the pointer tricks for memory management are not an exclusivity from C and C++. I get it! Just one more note, would you have done any

Re: Another opportunity for a major design win has presented itself

2013-02-07 Thread Walter Bright
On 2/7/2013 12:34 PM, Andrej Mitrovic wrote: What do you mean by design win? You mean we'd win another company over to D? Yes (for a project of theirs).

Re: Another opportunity for a major design win has presented itself

2013-02-07 Thread Andrej Mitrovic
On 2/7/13, Walter Bright newshou...@digitalmars.com wrote: On 2/7/2013 12:34 PM, Andrej Mitrovic wrote: What do you mean by design win? You mean we'd win another company over to D? Yes (for a project of theirs). Can you give us a teaser on generally what kind of work they do?

Re: Another opportunity for a major design win has presented itself

2013-02-07 Thread Maxim Fomin
On Thursday, 7 February 2013 at 20:16:03 UTC, Walter Bright wrote: No, I can't say who it is at this time. Sorry. But it is a huge opportunity for us. This is nice. To get the design win, we need to: (a) get dynamic linking and loading to work Wasn't this realized before? By the way, last

Re: Another opportunity for a major design win has presented itself

2013-02-07 Thread Walter Bright
On 2/7/2013 1:01 PM, Maxim Fomin wrote: I guess recent patches dedicated to the issue came at right time. The timing is indeed fortuitous. As for your comments about vagueness, yes, it is vague. The DLL support is clear, though, it either works or it doesn't. The other issues are a work in

Re: Another opportunity for a major design win has presented itself

2013-02-07 Thread Nick B
On Thursday, 7 February 2013 at 21:11:18 UTC, Walter Bright wrote: On 2/7/2013 1:01 PM, Maxim Fomin wrote: I guess recent patches dedicated to the issue came at right time. The timing is indeed fortuitous. As for your comments about vagueness, yes, it is vague. The DLL support is clear,

Re: Another opportunity for a major design win has presented itself

2013-02-07 Thread David
Am 07.02.2013 22:11, schrieb Walter Bright: On 2/7/2013 1:01 PM, Maxim Fomin wrote: I guess recent patches dedicated to the issue came at right time. The timing is indeed fortuitous. As for your comments about vagueness, yes, it is vague. The DLL support is clear, though, it either works

Re: Another opportunity for a major design win has presented itself

2013-02-07 Thread Oleg Kuporosov
On Thursday, 7 February 2013 at 20:16:03 UTC, Walter Bright wrote: No, I can't say who it is at this time. Sorry. But it is a huge opportunity for us. To get the design win, we need to: (a) get dynamic linking and loading to work (b) improve language safety without degrading efficiency (c)

Re: Another opportunity for a major design win has presented itself

2013-02-07 Thread Marco Leise
Am Thu, 07 Feb 2013 22:01:10 +0100 schrieb Maxim Fomin ma...@maxim-fomin.ru: On Thursday, 7 February 2013 at 20:16:03 UTC, Walter Bright wrote: (a) get dynamic linking and loading to work Wasn't this realized before? By the way, last weeks there seems to be increasing dynamic linking

Re: Another opportunity for a major design win has presented itself

2013-02-07 Thread Walter Bright
On 2/7/2013 10:36 PM, Oleg Kuporosov wrote: That is cool, but what is the target platform - Win/Lin, 32/64? Initially, Linux. Once that is worked out, doing the others should be straightforward.

Re: DIP25 draft available for destruction

2013-02-07 Thread deadalnix
On Thursday, 7 February 2013 at 07:41:57 UTC, Johannes Pfau wrote: Am Wed, 06 Feb 2013 23:45:51 +0100 schrieb Robert jfanati...@gmx.at: What happened to the scope storage class for parameters. Wouldn't this solve the problems, with the simple rule that you are not allowed to pass transient

Re: DIP25 draft available for destruction

2013-02-07 Thread Johannes Pfau
Am Wed, 06 Feb 2013 02:38:17 -0500 schrieb Andrei Alexandrescu seewebsiteforem...@erdani.org: Probably it'll need a fair amount of tweaking. Anyhow it's in destroyable form. http://wiki.dlang.org/DIP25 Thanks, Andrei Regarding the questions about scope parameters and allowing in

Re: Expanding Phobos from a flat hierachy

2013-02-07 Thread Jacob Carlborg
On 2013-02-06 18:35, Jens Mueller wrote: How about using YAML/JSON? name: dwt source: git://github.com/jacob-carlborg/dwt.git The reason is that it will come a need for having conditions, variables and similar in the YAML/JSON file. So instead of creating a new format, or extending

Re: DIP25 draft available for destruction

2013-02-07 Thread deadalnix
On Thursday, 7 February 2013 at 06:23:10 UTC, Walter Bright wrote: On 2/6/2013 10:13 PM, deadalnix wrote: It is a given that @properties can't 100M emulate field, but the goal should be to close he gap as much as possible. Ok, why should as much as possible be the goal? There are other

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

2013-02-07 Thread Lee Braiden
On Thu, 07 Feb 2013 00:31:20 +0100, Timon Gehr wrote: A.d:22:9: error: receiver for member function 'dup' is unqualified, but 'immutable' is required f = g.dup; ^ Is this what you'd want? Almost, it's definitely better, but what's wrong with: immutable object

Re: Expanding Phobos from a flat hierachy

2013-02-07 Thread Jacob Carlborg
On 2013-02-06 22:09, Walter Bright wrote: That's close enough to JSON to suggest: why not use JSON syntax? See: http://forum.dlang.org/thread/ugmacrokqghrrwpfo...@forum.dlang.org?page=4#post-kevo37:241gcn:241:40digitalmars.com -- /Jacob Carlborg

Re: DIP25 draft available for destruction

2013-02-07 Thread Rob T
On Thursday, 7 February 2013 at 05:54:29 UTC, deadalnix wrote: On Thursday, 7 February 2013 at 05:43:24 UTC, Rob T wrote: In other words @safe should explicitly mean I hereby verify that the code is safe not I will silently re-write your code in unknown ways to make it safe. @safe never

Re: Expanding Phobos from a flat hierachy

2013-02-07 Thread Jacob Carlborg
On 2013-02-06 16:41, Robert wrote: :-) That is pretty much what I had in mind! Awesome! I would love to help with this. I would start with some writing down of my ideas and concepts I have in mind, if you are interested? If you are, where should we discuss such things? On this mailing list?

Re: Expanding Phobos from a flat hierachy

2013-02-07 Thread Jacob Carlborg
On 2013-02-06 18:15, Dmitry Olshansky wrote: I've been wondering what happened to it, looks fine I think. I've been working on other projects for a while but now I've started to work on it again. -- /Jacob Carlborg

Re: DIP25 draft available for destruction

2013-02-07 Thread deadalnix
On Thursday, 7 February 2013 at 08:48:30 UTC, Rob T wrote: On Thursday, 7 February 2013 at 05:54:29 UTC, deadalnix wrote: On Thursday, 7 February 2013 at 05:43:24 UTC, Rob T wrote: In other words @safe should explicitly mean I hereby verify that the code is safe not I will silently re-write

Re: DIP25 draft available for destruction

2013-02-07 Thread Walter Bright
On 2/7/2013 12:22 AM, deadalnix wrote: Ok, why should as much as possible be the goal? There are other considerations - what merit should they have? I don't think anyone have interest to get back on that. If you have another answer to that question, please share. The point is, there must

Re: Expanding Phobos from a flat hierachy

2013-02-07 Thread Robert
On Thu, 2013-02-07 at 09:45 +0100, Jacob Carlborg wrote: Yes, I would be interested. I don't know what would be the best communication channel. Great! :-) I think for now, maybe this mailing list is not the worst place. (At least I don't know a better one) Best regards, Robert

Re: Expanding Phobos from a flat hierachy

2013-02-07 Thread Robert
As Sönke Ludwig seems to work on something very similar, it might make sense to join forces with him too. I will look into both implementations next week, to see where we stand. As I said, I will replace Ruby with D, that includes the DSL. It's the only place where Ruby is used. The rest is

Re: Expanding Phobos from a flat hierachy

2013-02-07 Thread Robert
I think the opposite. When we think about more concepts in Phobos, like gui, serialization, cryptography and so on, we will be able to create the right amount of hierarchy with distinguishable names. I'm in favor of a big batteries included library. Yeah, but I still think that breaking

Re: Expanding Phobos from a flat hierachy

2013-02-07 Thread Walter Bright
On 2/6/2013 6:58 PM, deadalnix wrote: Well Walter seems very worried about breaking code, but seems unable to adopt any practice the reduce its effect, and in the facts, my cod break at any new dmd release (and right now compile with none released one). Here's the current list of regressions:

Re: Expanding Phobos from a flat hierachy

2013-02-07 Thread Jacob Carlborg
On 2013-02-06 19:56, Brad Anderson wrote: I have a dream that someday phobos will just be a metapackage in a package manager that installs a set of core modules. What is needed to get Orbit off the ground (Kepler's law, I guess, would be the joke answer)? As with most things, it's time. I

Re: DIP25 draft available for destruction

2013-02-07 Thread deadalnix
On Thursday, 7 February 2013 at 09:23:20 UTC, Walter Bright wrote: The point is, there must always be a balance of competing interests. That's certainly true here. That is an assertion not an argument. Does C# always allow taking the address of a getter's return value? I don't know, but

Re: DIP25 draft available for destruction

2013-02-07 Thread deadalnix
On Thursday, 7 February 2013 at 06:36:22 UTC, H. S. Teoh wrote: D ref types are currently highly crippled because of the inability to declare ref variables, which mandates ugly workarounds. It should be a first-class type qualifier IMO. (Yes I know it's currently a *function* qualifier, not a

Re: DIP25 draft available for destruction

2013-02-07 Thread Walter Bright
On 2/7/2013 2:05 AM, deadalnix wrote: On Thursday, 7 February 2013 at 09:23:20 UTC, Walter Bright wrote: The point is, there must always be a balance of competing interests. That's certainly true here. That is an assertion not an argument. Try designing anything by using one overriding

Re: DIP25 draft available for destruction

2013-02-07 Thread Robert
The solution to this problem has been posted already many times, simply allow fields to be marked with @property too, having the compiler lower it to a private field with trivial setter/getter method. As I already mentioned, I don't really see the point of properties at all, if they are not

Re: Expanding Phobos from a flat hierachy

2013-02-07 Thread Jacob Carlborg
On 2013-02-06 22:24, David Nadlinger wrote: Somebody actually working on it. No offense, Jacob, but to me it seems like you have quite a few interesting projects (DVM, DStep, Orbit, …), and although you are usually quick to advertise them here, it seems that none of them is quite ready for

Re: DIP25 draft available for destruction

2013-02-07 Thread deadalnix
On Thursday, 7 February 2013 at 10:32:38 UTC, Walter Bright wrote: On 2/7/2013 2:05 AM, deadalnix wrote: On Thursday, 7 February 2013 at 09:23:20 UTC, Walter Bright wrote: The point is, there must always be a balance of competing interests. That's certainly true here. That is an assertion

Re: DIP25 draft available for destruction

2013-02-07 Thread Regan Heath
On Wed, 06 Feb 2013 17:36:24 -, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: A good part of that is the recent debate on what func should do (take the address of the function vs. the address of its result). With the unsafe meaning out of the way, only the safe one is

Re: Expanding Phobos from a flat hierachy

2013-02-07 Thread Walter Bright
On 2/6/2013 8:06 PM, Chad Joan wrote: Although I can sort of see the logic behind this convention, it is very hard to think of a function that operates on ranges and automatically know which module to look in. Unfortunately, I don't think any reorg will help with that, as all functions that

Re: Expanding Phobos from a flat hierachy

2013-02-07 Thread Jacob Carlborg
On 2013-02-06 18:22, Andrei Alexandrescu wrote: I understand. The way I see this is as an motivation and opportunity to add the necessary functionality to Phobos. I may be uninformed, but the way I see it basic package management doesn't have to be very demanding on library functionality. No

Extending readf?

2013-02-07 Thread monarch_dodra
Not so long ago, there was an amazing article about how user defined types and formated writes behaved: http://wiki.dlang.org/Defining_custom_print_format_specifiers As cool as it is, I was writting a little user defined type, and I wanted to the the contrary: un-format it to read it.

Re: Expanding Phobos from a flat hierachy

2013-02-07 Thread Jakob Ovrum
On Wednesday, 6 February 2013 at 22:25:03 UTC, Brad Anderson wrote: Reading more, it looks like Dub is his attempt to make VPM less Vibe.d specific and more for general D use. It even generates VisualD project files. Cool stuff. BA Yeah, I'm leaning towards DUB for a few reasons. The

Re: Extending readf?

2013-02-07 Thread Paulo Pinto
On Thursday, 7 February 2013 at 13:27:14 UTC, monarch_dodra wrote: ... For all the bashing C++'s and operators get, they at least work both ways for UDTs. ... I never understood why people like to bash about them. I am yet to find a codebase in production where it is not obvious from

Re: const(X) member of Y

2013-02-07 Thread Dan
On Thursday, 7 February 2013 at 05:30:27 UTC, Maxim Fomin wrote: On Wednesday, 6 February 2013 at 22:54:40 UTC, Dan wrote: This begs the question: Which of these do you choose and for what reasons: - this(this){} This is natural way to define struct postblit. This fully complies with

Re: Extending readf?

2013-02-07 Thread Andrei Alexandrescu
On 2/7/13 8:47 AM, Paulo Pinto wrote: On Thursday, 7 February 2013 at 13:27:14 UTC, monarch_dodra wrote: ... For all the bashing C++'s and operators get, they at least work both ways for UDTs. ... I never understood why people like to bash about them. I am yet to find a codebase in

Re: DIP23 Counter Proposal

2013-02-07 Thread Steven Schveighoffer
On Wed, 06 Feb 2013 21:53:25 -0500, deadalnix deadal...@gmail.com wrote: On Wednesday, 6 February 2013 at 21:30:10 UTC, Timon Gehr wrote: (fun, fun) Agh, comma strikes again. It should be handled analogous to the ternary expression. i.e. the expression above evaluates fun and then returns

Re: DIP23 Counter Proposal

2013-02-07 Thread Steven Schveighoffer
On Wed, 06 Feb 2013 16:30:09 -0500, Timon Gehr timon.g...@gmx.ch wrote: I do not have any hard data on this, but fun and (fun) meaning different things is extremely confusing. I can vouch that I find it confusing. At least on one other occasion, Walter nixed a feature because of this.

Re: DIP25 draft available for destruction

2013-02-07 Thread Zach the Mystic
On Thursday, 7 February 2013 at 09:23:20 UTC, Walter Bright wrote: DIP25 aim to solve the ref issue. Which is clearly useful. Conflating that goal with making previous DIP on function call is only going to export the mess in another area of the language. This is the very example of why

Re: DIP23 Counter Proposal

2013-02-07 Thread Timon Gehr
On 02/07/2013 02:56 PM, Steven Schveighoffer wrote: On Wed, 06 Feb 2013 21:53:25 -0500, deadalnix deadal...@gmail.com wrote: On Wednesday, 6 February 2013 at 21:30:10 UTC, Timon Gehr wrote: (fun, fun) Agh, comma strikes again. It should be handled analogous to the ternary expression. i.e.

Re: DIP25 draft available for destruction

2013-02-07 Thread Steven Schveighoffer
On Thu, 07 Feb 2013 01:06:34 -0500, Walter Bright newshou...@digitalmars.com wrote: The only time (now) that you can take the address of function return value is if that is a return by ref. So, if taking the address of a ref is disallowed, then the syntax is no longer ambiguous.

Re: Expanding Phobos from a flat hierachy

2013-02-07 Thread Timon Gehr
On 02/07/2013 03:58 AM, deadalnix wrote: ... my cod break at any new dmd release (and right now compile with none released one). +1. (I keep reporting regressions though, dustmite works quite well.)

Re: On DIP 23

2013-02-07 Thread eles
On Wednesday, 6 February 2013 at 22:10:29 UTC, Robert wrote: @properties are meant to emulate a field You're in the wrong spot of the world. Everywhere else outside the D community, the above assertion is held for true. In the D community, it is not. Yes, there are places like that, and

Re: DIP23 Counter Proposal

2013-02-07 Thread Steven Schveighoffer
On Wed, 06 Feb 2013 23:26:03 -0500, Chad Joan chadj...@gmail.com wrote: On 02/05/2013 09:45 PM, Steven Schveighoffer wrote: ... The semantic rewrite stuff is something I don't feel strongly either way. It would be nice, but at the same time, it doesn't feel necessary to me. One can always

Re: const(X) member of Y

2013-02-07 Thread Timon Gehr
On 02/07/2013 02:49 PM, Dan wrote: ... Why so much focus on new features like properties I guess because it is not a new feature, but another part where some things have not been hammered out sufficiently. (Also, it tends to generate larger threads. :o) ) when the fundamentals of const

Re: Expanding Phobos from a flat hierachy

2013-02-07 Thread FG
On 2013-02-07 09:19, Jacob Carlborg wrote: That's way I originally chose Ruby, because it can look just like JSON: foo = { a: 3, b: 4 } This looks like JSON but doesn't look like Ruby. :)

Re: const(X) member of Y

2013-02-07 Thread Dan
On Thursday, 7 February 2013 at 15:03:20 UTC, Timon Gehr wrote: const/immutable type checking currently is unsound during object construction in general. properties = candy const/immutable soundness = meat potatoes Evidence of tremedous energy and intellect here:

Re: Expanding Phobos from a flat hierachy

2013-02-07 Thread Marco Leise
Am Thu, 07 Feb 2013 05:19:56 +0100 schrieb Vladimir Panteleev vladi...@thecybershadow.net: On Wednesday, 6 February 2013 at 21:07:24 UTC, Walter Bright wrote: On 2/6/2013 12:15 AM, Jonathan M Davis wrote: I don't think that it's generally worth trying to rearrange the modules that we

Re: DIP25 draft available for destruction

2013-02-07 Thread Johannes Pfau
Am Thu, 07 Feb 2013 09:04:29 +0100 schrieb deadalnix deadal...@gmail.com: On Thursday, 7 February 2013 at 07:41:57 UTC, Johannes Pfau wrote: Am Wed, 06 Feb 2013 23:45:51 +0100 schrieb Robert jfanati...@gmx.at: What happened to the scope storage class for parameters. Wouldn't this

Re: DIP23 Counter Proposal

2013-02-07 Thread Regan Heath
On Thu, 07 Feb 2013 15:02:41 -, Steven Schveighoffer schvei...@yahoo.com wrote: On Wed, 06 Feb 2013 23:26:03 -0500, Chad Joan chadj...@gmail.com wrote: On 02/05/2013 09:45 PM, Steven Schveighoffer wrote: ... The semantic rewrite stuff is something I don't feel strongly either way. It

Re: Expanding Phobos from a flat hierachy

2013-02-07 Thread Marco Leise
Am Thu, 07 Feb 2013 04:02:29 +0100 schrieb deadalnix deadal...@gmail.com: Well if JSON syntax is better than D's why D don' use JSON syntax in the first place ? JSON is a well known format. The benefit is, parsers exist for every practical language and developers know by heart the syntax and

Re: On DIP 23

2013-02-07 Thread Dicebot
On Thursday, 7 February 2013 at 14:44:36 UTC, eles wrote: On Wednesday, 6 February 2013 at 22:10:29 UTC, Robert wrote: @properties are meant to emulate a field You're in the wrong spot of the world. Everywhere else outside the D community, the above assertion is held for true. In the D

Re: Extending readf?

2013-02-07 Thread H. S. Teoh
On Thu, Feb 07, 2013 at 02:27:12PM +0100, monarch_dodra wrote: Not so long ago, there was an amazing article about how user defined types and formated writes behaved: http://wiki.dlang.org/Defining_custom_print_format_specifiers As cool as it is, I was writting a little user defined type,

emacs ddoc-mode?

2013-02-07 Thread Andrei Alexandrescu
Hello, Having a ddoc mode for emacs would make documentation writing a lot more enjoyable. Is there anyone who's versed in defining emacs modes? Ddoc files have a simple structure: $(name introduces a level of indentation (e.g. 2 spaces) and gets highlighted, ) deindents, and at the end

Re: On DIP 23

2013-02-07 Thread Andrei Alexandrescu
On 2/7/13 9:44 AM, eles wrote: On Wednesday, 6 February 2013 at 22:10:29 UTC, Robert wrote: @properties are meant to emulate a field You're in the wrong spot of the world. Everywhere else outside the D community, the above assertion is held for true. In the D community, it is not. Yes,

Re: On DIP 23

2013-02-07 Thread Andrei Alexandrescu
On 2/7/13 10:55 AM, Dicebot wrote: On Thursday, 7 February 2013 at 14:44:36 UTC, eles wrote: On Wednesday, 6 February 2013 at 22:10:29 UTC, Robert wrote: @properties are meant to emulate a field You're in the wrong spot of the world. Everywhere else outside the D community, the above

Re: Expanding Phobos from a flat hierachy

2013-02-07 Thread Marco Leise
Am Wed, 06 Feb 2013 23:06:06 -0500 schrieb Chad Joan chadj...@gmail.com: I just want to say PLEASE YES. Phobos' module hierarchy is currently confusing at best, especially with various important elements being scattered across std.range, std.algorithm, std.array, and maybe another I'm

Re: On DIP 23

2013-02-07 Thread Robert
Heh, after that many topics and discussion I have started to think it would have been better if initial proposal to remove them altogether succeeded. Same feeling here. But I'll try to be constructive and I hope I find the time to write yet another DIP about properties next week. UFCS and

Re: const(X) member of Y

2013-02-07 Thread FG
On 2013-02-06 23:14, Maxim Fomin wrote: On Wednesday, 6 February 2013 at 21:47:35 UTC, Dan wrote: On Wednesday, 6 February 2013 at 20:30:40 UTC, Maxim Fomin wrote: The fact that bar() does not work and (bar)() works is terrific. Sorry - but I don't understand what is terrific? Is this

Re: DIP25 draft available for destruction

2013-02-07 Thread Rob T
On Thursday, 7 February 2013 at 09:21:38 UTC, deadalnix wrote: On Thursday, 7 February 2013 at 08:48:30 UTC, Rob T wrote: On Thursday, 7 February 2013 at 05:54:29 UTC, deadalnix wrote: On Thursday, 7 February 2013 at 05:43:24 UTC, Rob T wrote: In other words @safe should explicitly mean I

Taking address of properties

2013-02-07 Thread Robert
Properties provide a means of access control to fields. (Range checks, only readable, only writable, triggering a signal on change, ...) So as posted a few times, taking the address of the ref return value of a property is of no value at all. If you want someone to be able to take the address of

nextPermutation and ranges

2013-02-07 Thread bearophile
Recently quickfur and Andrei have added C++-style functions (nextPermutation and nextEvenPermutation) to std.algorithm to perform permutations, this is a Phobos improvement and I've already used them few times:

Re: Taking address of properties

2013-02-07 Thread FG
On 2013-02-07 19:05, Robert wrote: taking the address of the ref return value of a property is of no value at all. If you want someone to be able to take the address of a field, you should make it simply public (without @property), because the @property accessor methods won't gain you anything

Re: nextPermutation and ranges

2013-02-07 Thread H. S. Teoh
On Thu, Feb 07, 2013 at 07:22:10PM +0100, bearophile wrote: Recently quickfur That's my github handle. and Andrei have added C++-style functions (nextPermutation and nextEvenPermutation) to std.algorithm to perform permutations, this is a Phobos improvement and I've already used them few

Re: On DIP 23

2013-02-07 Thread Dicebot
On Thursday, 7 February 2013 at 16:35:17 UTC, Andrei Alexandrescu wrote: I felt we were getting somewhere. Andrei Both yes and no at the same time. Last proposals did a great job addressing different issues regarding property syntax and I somewhat like them in that sense. But they miss an

Re: Expanding Phobos from a flat hierachy

2013-02-07 Thread Paul D. Anderson
On Wednesday, 6 February 2013 at 07:56:26 UTC, Don wrote: In the Implementing Half Floats in D thread, we seemed to have reached a consensus on two important points: (a) Phobos should have a broad scope (rather than being small like the C standard library). (b) The current flat structure of

Re: On DIP 23

2013-02-07 Thread H. S. Teoh
On Thu, Feb 07, 2013 at 07:55:22PM +0100, Dicebot wrote: On Thursday, 7 February 2013 at 16:35:17 UTC, Andrei Alexandrescu wrote: I felt we were getting somewhere. Andrei Both yes and no at the same time. Last proposals did a great job addressing different issues regarding property

Re: Taking address of properties

2013-02-07 Thread Steven Schveighoffer
On Thu, 07 Feb 2013 13:05:50 -0500, Robert jfanati...@gmx.at wrote: Properties provide a means of access control to fields. (Range checks, only readable, only writable, triggering a signal on change, ...) So as posted a few times, taking the address of the ref return value of a property is of

Re: Taking address of properties

2013-02-07 Thread Robert
Good point, but I think that this is pretty much a corner case where it occasionally might be useful, but it does not rectify the consequences: The moment you are allowed to take the address, you are stuck with the ref returning accessor and can not change it later to a get/set pair. An easy

Re: nextPermutation and ranges

2013-02-07 Thread Peter Alexander
Someone is already working on std.combinatorics That's me. I'm very bust atm with work, so I haven't been able to do much with it lately, but it is progressing. 1) To avoid excessive allocations, it would have to be a transient range. Which means it may have unexpected results if you use

Re: nextPermutation and ranges

2013-02-07 Thread bearophile
H. S. Teoh: 1) To avoid excessive allocations, it would have to be a transient range. See the doCopy boolean template argument in my code. Note that it's true on default. (D Zen: do the safe thing on default, and the fast thing on request). 2) If the starting range is not sorted, then

Re: DIP25 draft available for destruction

2013-02-07 Thread Walter Bright
On 2/7/2013 6:15 AM, Zach the Mystic wrote: Can you tell me if you consider my proposal with regard to making ref safe and complete simple and intuitive both for compiler and user, and if not, why? (I don't have an opinion about '' yet.)

Re: DIP25 draft available for destruction

2013-02-07 Thread Walter Bright
On 2/7/2013 3:16 AM, deadalnix wrote: The 'funny' things is that C#'s would cause syntax problem issue with address of, where D does. I don't understand this sentence. In C#, foo.bar won't execute bar's method of foo. It will get what is called in D a delegate. foo.bar() execute that

Re: nextPermutation and ranges

2013-02-07 Thread H. S. Teoh
On Thu, Feb 07, 2013 at 08:40:25PM +0100, Peter Alexander wrote: [...] 1) To avoid excessive allocations, it would have to be a transient range. Which means it may have unexpected results if you use it with an algorithm that doesn't handle transient ranges correctly. This has been discussed

Re: nextPermutation and ranges

2013-02-07 Thread H. S. Teoh
On Thu, Feb 07, 2013 at 08:47:39PM +0100, bearophile wrote: H. S. Teoh: 1) To avoid excessive allocations, it would have to be a transient range. See the doCopy boolean template argument in my code. Note that it's true on default. (D Zen: do the safe thing on default, and the fast thing

Re: Expanding Phobos from a flat hierachy

2013-02-07 Thread Jonathan M Davis
On Thursday, February 07, 2013 13:17:20 Jacob Carlborg wrote: On 2013-02-06 18:22, Andrei Alexandrescu wrote: I understand. The way I see this is as an motivation and opportunity to add the necessary functionality to Phobos. I may be uninformed, but the way I see it basic package management

Re: Taking address of properties

2013-02-07 Thread Andrei Alexandrescu
On 2/7/13 2:13 PM, Steven Schveighoffer wrote: On Thu, 07 Feb 2013 13:05:50 -0500, Robert jfanati...@gmx.at wrote: Properties provide a means of access control to fields. (Range checks, only readable, only writable, triggering a signal on change, ...) So as posted a few times, taking the

Re: On DIP 23

2013-02-07 Thread eles
On Thursday, 7 February 2013 at 16:33:46 UTC, Andrei Alexandrescu wrote: On 2/7/13 9:44 AM, eles wrote: On Wednesday, 6 February 2013 at 22:10:29 UTC, Robert wrote: I think the sarcasm is uncalled for. We're doing our best here and our intent is indeed to have properties emulate fields. At

Re: nextPermutation and ranges

2013-02-07 Thread bearophile
H. S. Teoh: any implementation based on factorial would have to address the issue of how to handle the exponential growth. I think it'sunacceptable for the standard library to support permutations only up to ranges of 20 elements or less, because 21! 2^64. What are the use cases of

Re: DIP23 Counter Proposal

2013-02-07 Thread Jonathan M Davis
On Thursday, February 07, 2013 10:02:41 Steven Schveighoffer wrote: On Wed, 06 Feb 2013 23:26:03 -0500, Chad Joan chadj...@gmail.com wrote: On 02/05/2013 09:45 PM, Steven Schveighoffer wrote: ... The semantic rewrite stuff is something I don't feel strongly either way. It would be

Re: nextPermutation and ranges

2013-02-07 Thread H. S. Teoh
On Thu, Feb 07, 2013 at 09:24:24PM +0100, bearophile wrote: H. S. Teoh: any implementation based on factorial would have to address the issue of how to handle the exponential growth. I think it'sunacceptable for the standard library to support permutations only up to ranges of 20 elements

Re: nextPermutation and ranges

2013-02-07 Thread bearophile
H. S. Teoh: Combinatorial puzzles come to mind (Rubik's cube solvers and its ilk, for example). Maybe other combinatorial problems that require some kind of exhaustive state space search. Those things easily go past 20! once you get beyond the most trivial cases. I know many

Re: Taking address of properties

2013-02-07 Thread Robert
It depends on how we are going to define properties and with all the arguments in the discussions it seems to me that the only sane way to design properties is as simple front ends for private fields (which is my understanding of properties anyway). But with optional parantheses the @property

Re: Taking address of properties

2013-02-07 Thread Robert
Just to be clear here, with DIP23 in place, the syntax at the caller side for: @property ref T front(T[] arr) { return arr[0];} would not change if you remove the @property. So little code breakage here and the code that breaks is easily fixed by removing @property.

Re: nextPermutation and ranges

2013-02-07 Thread Dmitry Olshansky
08-Feb-2013 00:04, H. S. Teoh пишет: On Thu, Feb 07, 2013 at 08:40:25PM +0100, Peter Alexander wrote: [...] 1) To avoid excessive allocations, it would have to be a transient range. Which means it may have unexpected results if you use it with an algorithm that doesn't handle transient ranges

Re: DIP23 Counter Proposal

2013-02-07 Thread Dan
On Thursday, 7 February 2013 at 20:26:10 UTC, Jonathan M Davis wrote: It works as long as you can limit the variable in some way. But I believe that the main purpose in using public variables rather than actual property functions when all they would do is get or set the variable is to avoid

Re: DIP23 Counter Proposal

2013-02-07 Thread Robert
struct S { @property int i; } You missed the point. When this gets lowered to accessor functions and a private variable, you ensure that you can later on add your magic soup, without breaking code that relied on i being a real field. (E.g. taking the address, using +=, -=, ...)

Re: Taking address of properties

2013-02-07 Thread Steven Schveighoffer
On Thu, 07 Feb 2013 15:57:56 -0500, Robert jfanati...@gmx.at wrote: Just to be clear here, with DIP23 in place, the syntax at the caller side for: @property ref T front(T[] arr) { return arr[0];} would not change if you remove the @property. So little code breakage here and the code that

Re: Expanding Phobos from a flat hierachy

2013-02-07 Thread Brad Anderson
On Wednesday, 6 February 2013 at 18:47:35 UTC, Brad Anderson wrote: On Wednesday, 6 February 2013 at 11:38:31 UTC, Dicebot wrote: AFAIR there was proposal of a future meta package for introducing new modules with time to adapt, similar to how it is done in few other languages. I really like

Re: Taking address of properties

2013-02-07 Thread Steven Schveighoffer
On Thu, 07 Feb 2013 15:14:22 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 2/7/13 2:13 PM, Steven Schveighoffer wrote: On Thu, 07 Feb 2013 13:05:50 -0500, Robert jfanati...@gmx.at wrote: Properties provide a means of access control to fields. (Range checks, only

Re: DIP23 Counter Proposal

2013-02-07 Thread Steven Schveighoffer
On Thu, 07 Feb 2013 15:25:57 -0500, Jonathan M Davis jmdavisp...@gmx.com wrote: struct S { @property int i; } struct S { mixin(boilerplateProperty(i)); } I don't see this as a difficult problem to solve. -Steve

Re: DIP23 Counter Proposal

2013-02-07 Thread Dan
On Thursday, 7 February 2013 at 21:12:35 UTC, Steven Schveighoffer wrote: struct S { mixin(boilerplateProperty(i)); } I don't see this as a difficult problem to solve. -Steve +1

Re: DIP23 Counter Proposal

2013-02-07 Thread Geancarlo Rocha
In C#, they have introduced automatic properties for that purpose of initial encapsulation: public int i { get; set; } //get and set can be modified with private etc Then the getter and setter methods are automatically implemented. I'm not closely following the discussions involved in the

Re: DIP23 Counter Proposal

2013-02-07 Thread Dan
On Thursday, 7 February 2013 at 21:05:49 UTC, Robert wrote: You missed the point. When this gets lowered to accessor functions and a private variable, you ensure that you can later on add your magic soup, without breaking code that relied on i being a real field. (E.g. taking the address,

Re: Expanding Phobos from a flat hierachy

2013-02-07 Thread Jacob Carlborg
On 2013-02-06 23:00, Andrei Alexandrescu wrote: I'll start with some top posting and summarize. I use what works. If that means using some third party library I have no problem with that. Why should I reimplement something and hope for inclusion into Phobos when there already exist a

Re: Taking address of properties

2013-02-07 Thread Robert
On Thu, 2013-02-07 at 16:08 -0500, Steven Schveighoffer wrote: int delegate()[] arr; arr.front(); That's part of the mess we are trying to clean up here? As of DIP 23, you would have to do arr.front()() in order to actually call the delegate. The current behaviour is also that you have to do

  1   2   3   >