Re: Higher Order Range Pattern

2015-06-22 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/22/15 11:04 AM, Dennis Ritchie wrote: Hi, I recently came across the following code: http://wiki.dlang.org/Higher_Order_Range_Pattern I can't understand why the properties and methods of the structure are called in the correct order. Why are the property `back()` and the method

Re: Higher Order Range Pattern

2015-06-22 Thread Dennis Ritchie via Digitalmars-d-learn
On Monday, 22 June 2015 at 15:25:12 UTC, Steven Schveighoffer wrote: On 6/22/15 11:04 AM, Dennis Ritchie wrote: Hi, I recently came across the following code: http://wiki.dlang.org/Higher_Order_Range_Pattern I can't understand why the properties and methods of the structure are called in

Re: auto ref is on the docket

2015-06-22 Thread Namespace via Digitalmars-d
Rather than raising the matter of scope again and again, we should be thankful that a solution for this nasty problem is accepted and could be merged. How scope and escape analysis could do a better job is unclear and if you want to solve the problem this way you will wait a very long time. So

Re: Naming things

2015-06-22 Thread Joseph Cassman via Digitalmars-d
On Monday, 22 June 2015 at 16:06:33 UTC, Kelet wrote: I agree with Vladimir -- There should be a naming convention for identifying whether a function is eager or lazy. Learning a naming convention once and applying it repeatedly is a better process than repeatedly referencing documentation.

Re: D could catch this wave: web assembly

2015-06-22 Thread via Digitalmars-d
On Sunday, 21 June 2015 at 11:56:13 UTC, Joakim wrote: importance of which Wyatt and I discussed above. Just by webasm being implemented in all major browsers, it would certainly lead to a _lot_ less javascript getting written, once devs actually have a choice of other languages, even if

How do I make my class iterable?

2015-06-22 Thread Assembly via Digitalmars-d-learn
Does D has an equivalent to C#'s iterator (https://msdn.microsoft.com/en-us/library/65zzykke.aspx)? if so, where can I find it? What I want is loop over a user-defined class/struct. In case of C#, I just implement the IEnumerable and the GetEnumerator() methods that's called by the foreach()

Re: How do I make my class iterable?

2015-06-22 Thread Ali Çehreli via Digitalmars-d-learn
On 06/22/2015 09:37 AM, q66 wrote: use opApply. Yes. Additionally, an InputRange interface can be used: http://ddili.org/ders/d.en/foreach_opapply.html Ali

Re: auto ref is on the docket

2015-06-22 Thread via Digitalmars-d
On Monday, 22 June 2015 at 16:10:10 UTC, Namespace wrote: Rather than raising the matter of scope again and again, we should be thankful that a solution for this nasty problem is accepted and could be merged. I disagree strongly with this. A bad solution is worse than no solution. How

Re: auto ref is on the docket

2015-06-22 Thread Namespace via Digitalmars-d
We had this discussion already with DIP 36. A PR still exists AFAIK, but because it was rejected I don't think that's going to happen. :) So auto ref is obviously the choice. If you insist on scope/in ref, please make your own thread and ask why it was rejected or read the corresponding

Re: Naming things

2015-06-22 Thread Kelet via Digitalmars-d
I agree with Vladimir -- There should be a naming convention for identifying whether a function is eager or lazy. Learning a naming convention once and applying it repeatedly is a better process than repeatedly referencing documentation. A programming language should have built-in

[Issue 14719] Template instantiation parsed as C-style type cast

2015-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14719 --- Comment #2 from Yuxuan Shui yshu...@gmail.com --- (In reply to Kenji Hara from comment #1) (In reply to Yuxuan Shui from comment #0) (a!A)!B Which is parsed as a C-style cast. It's not a bug. The code is parsed as: (a!A)// a type

Re: How do I make my class iterable?

2015-06-22 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/22/15 1:03 PM, Assembly wrote: On Monday, 22 June 2015 at 16:52:15 UTC, Ali Çehreli wrote: On 06/22/2015 09:37 AM, q66 wrote: use opApply. Yes. Additionally, an InputRange interface can be used: http://ddili.org/ders/d.en/foreach_opapply.html Ali I was reading exaclty this page

Re: auto ref is on the docket

2015-06-22 Thread Andrei Alexandrescu via Digitalmars-d
On 6/22/15 3:04 AM, Marc =?UTF-8?B?U2Now7x0eiI=?= schue...@gmx.net wrote: Just lower it to: { auto tmp = 5; fun(tmp); } You need to lower an expression to an expression, not a statement. (e.g. what if fun returns a result?) I considered this lowering for int

Re: How do I make my class iterable?

2015-06-22 Thread Assembly via Digitalmars-d-learn
On Monday, 22 June 2015 at 16:52:15 UTC, Ali Çehreli wrote: On 06/22/2015 09:37 AM, q66 wrote: use opApply. Yes. Additionally, an InputRange interface can be used: http://ddili.org/ders/d.en/foreach_opapply.html Ali I was reading exaclty this page that. I've had implmented this

Re: Erroneous auto can only be used for template function parameters?

2015-06-22 Thread Yuxuan Shui via Digitalmars-d-learn
On Monday, 22 June 2015 at 13:49:21 UTC, Steven Schveighoffer wrote: On 6/20/15 10:26 PM, Yuxuan Shui wrote: On Sunday, 21 June 2015 at 01:26:51 UTC, Adam D. Ruppe wrote: On Saturday, 20 June 2015 at 01:50:11 UTC, Yuxuan Shui wrote: auto ref R) is indeed a template function, so I don't

Re: auto ref is on the docket

2015-06-22 Thread via Digitalmars-d
On Monday, 22 June 2015 at 13:49:31 UTC, Jonathan M Davis wrote: On Monday, 22 June 2015 at 13:23:47 UTC, Marc Schütz wrote: On Monday, 22 June 2015 at 04:11:41 UTC, Andrei Alexandrescu wrote: Walter and I discussed what auto ref for templates should look like and reached the conclusion that

Re: auto ref is on the docket

2015-06-22 Thread via Digitalmars-d
On Monday, 22 June 2015 at 15:39:38 UTC, Andrei Alexandrescu wrote: On 6/22/15 3:04 AM, Marc =?UTF-8?B?U2Now7x0eiI=?= schue...@gmx.net wrote: Just lower it to: { auto tmp = 5; fun(tmp); } You need to lower an expression to an expression, not a statement. (e.g.

Re: D could catch this wave: web assembly

2015-06-22 Thread Nick Sabalausky via Digitalmars-d
On 06/22/2015 05:16 AM, Joakim wrote: I really liked the new Fisher-Price style of desktop Windows 8, Ugh, now *that* one I don't like. Simplicity is nice, but ugly is just ugly. It looks like a re-imagining of Win1 and Win2 drawn up by a hung-over unicorn ;) along with better

Re: std.collection - changing the collection while iterating

2015-06-22 Thread Joseph Cassman via Digitalmars-d
On Monday, 22 June 2015 at 13:42:41 UTC, Steven Schveighoffer wrote: On 6/22/15 2:27 AM, Joseph Cassman wrote: On Sunday, 21 June 2015 at 23:02:38 UTC, Andrei Alexandrescu wrote: [...] I was trying to understand how it could work with array slices. For example, I was thinking of code

Re: Future(s) for D.

2015-06-22 Thread Sebastiaan Koppe via Digitalmars-d
On Saturday, 20 June 2015 at 12:35:11 UTC, weaselcat wrote: I recently read this facebook post on their future implementation in their Folly library. https://code.facebook.com/posts/1661982097368498 This made me slightly envious. Thoughts on a D implementation? After having worked with

Re: How do I make my class iterable?

2015-06-22 Thread q66 via Digitalmars-d-learn
On Monday, 22 June 2015 at 16:33:43 UTC, Assembly wrote: Does D has an equivalent to C#'s iterator (https://msdn.microsoft.com/en-us/library/65zzykke.aspx)? if so, where can I find it? What I want is loop over a user-defined class/struct. In case of C#, I just implement the IEnumerable and

Re: Does D has built-in stack structure?

2015-06-22 Thread Assembly via Digitalmars-d-learn
On Monday, 22 June 2015 at 08:18:08 UTC, Adrian Matoga wrote: On Monday, 22 June 2015 at 06:09:48 UTC, Assembly wrote: Does D has built-in stack structure (if so, which module?) or should I implement it myself? AFAIK there's no built-in, but std.array.Appender could be easily wrapped in an

Re: PHP verses C#.NET verses D.

2015-06-22 Thread Etienne via Digitalmars-d
On Monday, 22 June 2015 at 06:32:31 UTC, Nick B wrote: On Thursday, 18 June 2015 at 03:44:08 UTC, Etienne Cimon wrote: Etienne Would you like to detail what still needs to be completed/on the to-do list ? What would be the best way to learn it ? Does it need documentation as well ?

Higher Order Range Pattern

2015-06-22 Thread Dennis Ritchie via Digitalmars-d-learn
Hi, I recently came across the following code: http://wiki.dlang.org/Higher_Order_Range_Pattern I can't understand why the properties and methods of the structure are called in the correct order. Why are the property `back()` and the method `popBack()` are not called even once? In general,

Re: Erroneous auto can only be used for template function parameters?

2015-06-22 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/22/15 1:37 PM, Yuxuan Shui wrote: On Monday, 22 June 2015 at 13:49:21 UTC, Steven Schveighoffer wrote: On 6/20/15 10:26 PM, Yuxuan Shui wrote: On Sunday, 21 June 2015 at 01:26:51 UTC, Adam D. Ruppe wrote: On Saturday, 20 June 2015 at 01:50:11 UTC, Yuxuan Shui wrote: auto ref R) is

[Issue 14704] The design, which allows not to write import, import, import ... for selective imports

2015-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14704 --- Comment #34 from dennis.m.ritc...@mail.ru --- (In reply to Ketmar Dark from comment #33) (In reply to dennis.m.ritchie from comment #31) so i was right: you choose to go personal 'cause you have zero technical arguments. thanks for not hiding

[Issue 14704] The design, which allows not to write import, import, import ... for selective imports

2015-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14704 --- Comment #35 from dennis.m.ritc...@mail.ru --- (In reply to dennis.m.ritchie from comment #34) Why 29 times to copy the keyword `import`, if you can write only once? Proper programming is ergonomic programming! --

Re: forum.dlang.org, version 2 (BETA)

2015-06-22 Thread Laeeth Isharc via Digitalmars-d-announce
Minor bug in forum (was in previous one too). If you get an error from posting a message due to eg malformed email address then you are unable to submit a post again after correcting the error (because you tried to post too recently).

Re: How do I make my class iterable?

2015-06-22 Thread Assembly via Digitalmars-d-learn
On Monday, 22 June 2015 at 17:09:16 UTC, Steven Schveighoffer wrote: On 6/22/15 1:03 PM, Assembly wrote: [...] TBH, opApply is much better suited to classes. But in order to have multiple parameters with foreach by using a range, you must return a tuple: auto front() { import

Re: Scriptlike v0.8.0

2015-06-22 Thread Nick Sabalausky via Digitalmars-d-announce
On 06/22/2015 05:09 AM, Per =?UTF-8?B?Tm9yZGzDtnci?= per.nord...@gmail.com wrote: On Monday, 22 June 2015 at 09:08:45 UTC, Per Nordlöw wrote: Something like this userInput(T)(string message, T x); Correction, should be userInput(T)(string message, ref T x) Good idea. Now added,

Re: What have you done with UDAs?

2015-06-22 Thread extrawurst via Digitalmars-d
On Monday, 22 June 2015 at 19:09:40 UTC, weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? They are great! see my post about one use case: http://extrawurst.github.io/dlang/metaprogramming/imgui/2015/05/28/dlang-annotations.html

Re: What have you done with UDAs?

2015-06-22 Thread Jonas Drewsen via Digitalmars-d
On Monday, 22 June 2015 at 19:09:40 UTC, weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? I use a few in the deadcode editor e.g.: Function can be called by a menu entry: @MenuItem(Edit/Copy) Function can be called by a shortcut:

Re: auto ref is on the docket

2015-06-22 Thread Daniel N via Digitalmars-d
On Monday, 22 June 2015 at 05:25:57 UTC, Walter Bright wrote: The idea is that fun(5) would be lowered to: auto tmp = 5; fun(tmp); But when talking to Andrei I didn't realize that it would be subtly different behavior than 'auto ref' for template functions, which makes me concerned

Re: auto ref is on the docket

2015-06-22 Thread Daniel N via Digitalmars-d
On Monday, 22 June 2015 at 20:50:23 UTC, Namespace wrote: That would be horrible. How would you distinguish between lvalues and rvalues? What if you want to store a pointer to an lvalue? If ref accept both you cannot do that. storing requires 'return ref'

Re: What have you done with UDAs?

2015-06-22 Thread E.S. Quinn via Digitalmars-d
On Monday, 22 June 2015 at 19:09:40 UTC, weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? I use UDAs in my project to generate GTK UI for editing components in my ECS. (For things like marking string fields as filenames, or giving

Re: What have you done with UDAs?

2015-06-22 Thread Basile Burg via Digitalmars-d
On Monday, 22 June 2015 at 19:09:40 UTC, weaselcat wrote: I never seem to use them for anything, has anyone else done anything interesting with them? I use them to annotate the setter/getter pairs in classes. Two analyzers look for them to automatically create what i call a property

Re: Phobos addition formal review: std.experimental.allocator

2015-06-22 Thread Andrei Alexandrescu via Digitalmars-d
On 6/21/15 4:47 AM, Dicebot wrote: 4. There are no higher level usage examples and/or guidelines about how this is supposed to fit in user applications. Intention behind the library may be familiar to users coming from C++ but target D audience is much more than that. Having

Re: Phobos addition formal review: std.experimental.allocator

2015-06-22 Thread Dicebot via Digitalmars-d
On Monday, 22 June 2015 at 19:51:50 UTC, Andrei Alexandrescu wrote: 2. `IAllocator` is defined inside `package.d` file. That means that it is impossible to use interface without import ALL of allocator modules Fixed, now interested users need to import

Re: auto ref is on the docket

2015-06-22 Thread Namespace via Digitalmars-d
On Monday, 22 June 2015 at 20:42:58 UTC, Daniel N wrote: On Monday, 22 June 2015 at 05:25:57 UTC, Walter Bright wrote: The idea is that fun(5) would be lowered to: auto tmp = 5; fun(tmp); But when talking to Andrei I didn't realize that it would be subtly different behavior than 'auto

Re: core.exception.InvalidMemoryOperationError@(0) on File Reading.

2015-06-22 Thread anonymous via Digitalmars-d-learn
On Monday, 22 June 2015 at 20:30:40 UTC, David DeWitt wrote: I am getting an core.exception.InvalidMemoryOperationError@(0) auto recs = f // Open for reading .byLineCopy(); .array; //Here is where is appears to be happening. I have

Re: auto ref is on the docket

2015-06-22 Thread Daniel N via Digitalmars-d
On Monday, 22 June 2015 at 20:56:12 UTC, Jonathan M Davis wrote: won't mutate the argument, but if you allow it with ref in general, then you stand no chance of being able to look at a function signature and deduce whether the function intends to mutate an argument or not. - Jonathan M Davis

Re: Phobos addition formal review: std.experimental.allocator

2015-06-22 Thread Andrei Alexandrescu via Digitalmars-d
On 6/21/15 4:47 AM, Dicebot wrote: 5. http://erdani.com/d/phobos-prerelease/std_experimental_allocator_stats_collector.html has no overview documentation at all https://github.com/D-Programming-Language/phobos/commit/ef6de891197db6d497df11c9350781eef38df196 Andrei

Re: auto ref is on the docket

2015-06-22 Thread Timon Gehr via Digitalmars-d
On 06/23/2015 12:18 AM, kinke wrote: In C++ there's no problem with const, so why they will be in D? Because const is transitive in D and therefore more restrictive. That's not a reason. Yes it is. It's just an additional restriction imposed by D and only prevents you from using the

Re: Erroneous auto can only be used for template function parameters?

2015-06-22 Thread Yuxuan Shui via Digitalmars-d-learn
On Saturday, 20 June 2015 at 01:50:11 UTC, Yuxuan Shui wrote: Try to compile this code snippet: import std.traits; template a(R) { auto a(S)(auto ref R i) { return cast(S)i*2; } } template ReturnTypeEx(alias A, B) { alias ReturnTypeEx = ReturnType!(A!B);

Re: What have you done with UDAs?

2015-06-22 Thread Manu via Digitalmars-d
On 23 June 2015 at 05:09, weaselcat via Digitalmars-d digitalmars-d@puremagic.com wrote: I never seem to use them for anything, has anyone else done anything interesting with them? I've used them for attributing struct members with some information about their semantic meaning, which allows

[Issue 14720] Template function reported as non-template

2015-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14720 --- Comment #3 from Kenji Hara k.hara...@gmail.com --- (In reply to Yuxuan Shui from comment #2) Seems this bug is not related to nested templates at all, it's more likely an 'auto ref' bug: `auto ref` parameter is allowed for template functions,

Re: auto ref is on the docket

2015-06-22 Thread Timon Gehr via Digitalmars-d
On 06/22/2015 06:11 AM, Andrei Alexandrescu wrote: Walter and I discussed what auto ref for templates should look like and reached the conclusion that an approach based on lowering would be best. I added a proposed lowering to https://github.com/D-Programming-Language/dmd/pull/4717. Andrei

Re: Phobos addition formal review: std.experimental.allocator

2015-06-22 Thread Andrei Alexandrescu via Digitalmars-d
On 6/22/15 2:40 PM, Dicebot wrote: On Monday, 22 June 2015 at 19:51:50 UTC, Andrei Alexandrescu wrote: 2. `IAllocator` is defined inside `package.d` file. That means that it is impossible to use interface without import ALL of allocator modules Fixed, now interested users need to import

Re: auto ref is on the docket

2015-06-22 Thread Timon Gehr via Digitalmars-d
On 06/23/2015 12:40 AM, Andrei Alexandrescu wrote: On 6/22/15 3:06 PM, Timon Gehr wrote: On 06/22/2015 06:11 AM, Andrei Alexandrescu wrote: Walter and I discussed what auto ref for templates should look like and reached the conclusion that an approach based on lowering would be best. I added a

[Issue 14720] Template function reported as non-template

2015-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14720 --- Comment #4 from Yuxuan Shui yshu...@gmail.com --- (In reply to Kenji Hara from comment #3) (In reply to Yuxuan Shui from comment #2) Seems this bug is not related to nested templates at all, it's more likely an 'auto ref' bug: `auto ref`

Re: D could catch this wave: web assembly

2015-06-22 Thread Nick Sabalausky via Digitalmars-d
On 06/22/2015 04:01 PM, Joseph Rushton Wakeling wrote: On Sunday, 21 June 2015 at 15:59:57 UTC, Nick Sabalausky wrote: On 06/21/2015 09:45 AM, Joseph Rushton Wakeling wrote: Threw what in the trash-bin? https://en.wikipedia.org/wiki/Ubuntu_for_Android Though I may very well be missing

Re: auto ref is on the docket

2015-06-22 Thread Dennis Ritchie via Digitalmars-d
On Monday, 22 June 2015 at 04:11:41 UTC, Andrei Alexandrescu wrote: Walter and I discussed what auto ref for templates should look like and reached the conclusion that an approach based on lowering would be best. I added a proposed lowering to

Re: Erroneous auto can only be used for template function parameters?

2015-06-22 Thread Jesse Phillips via Digitalmars-d-learn
On Sunday, 21 June 2015 at 02:37:59 UTC, Yuxuan Shui wrote: On Sunday, 21 June 2015 at 01:26:51 UTC, Adam D. Ruppe wrote: On Saturday, 20 June 2015 at 01:50:11 UTC, Yuxuan Shui wrote: auto ref R) is indeed a template function, so I don't understand. But R is not a parameter on the function

Re: auto ref is on the docket

2015-06-22 Thread kinke via Digitalmars-d
On Monday, 22 June 2015 at 23:04:14 UTC, Timon Gehr wrote: On 06/23/2015 12:18 AM, kinke wrote: In C++ there's no problem with const, so why they will be in D? Because const is transitive in D and therefore more restrictive. That's not a reason. Yes it is. It's just an additional

[Issue 5941] Using inner struct which references nested function in a no-attribute or auto-return member function causes nested function cannot be accessed error

2015-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=5941 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED

Re: auto ref is on the docket

2015-06-22 Thread Andrei Alexandrescu via Digitalmars-d
On 6/22/15 4:09 PM, Timon Gehr wrote: There is no reason to prevent templates from using the mechanism that generates only one copy. The two mechanisms shouldn't share the same syntax, because then there is no way to tell them apart for template functions. I understand. For my money I'd be

[Issue 14720] Template function reported as non-template

2015-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14720 --- Comment #1 from Yuxuan Shui yshu...@gmail.com --- I simplified the example a little bit: import std.traits, std.range; template ReturnTypeEx(alias A, B) { alias ReturnTypeEx = ReturnType!(A!B); } void a(S)(auto ref S i) { } template b(alias

Re: auto ref is on the docket

2015-06-22 Thread Timon Gehr via Digitalmars-d
On 06/23/2015 01:27 AM, kinke wrote: On Monday, 22 June 2015 at 23:04:14 UTC, Timon Gehr wrote: On 06/23/2015 12:18 AM, kinke wrote: In C++ there's no problem with const, so why they will be in D? Because const is transitive in D and therefore more restrictive. That's not a reason. Yes

Re: auto ref is on the docket

2015-06-22 Thread Jesse Phillips via Digitalmars-d
On Monday, 22 June 2015 at 04:11:41 UTC, Andrei Alexandrescu wrote: Walter and I discussed what auto ref for templates should look like and reached the conclusion that an approach based on lowering would be best. I added a proposed lowering to

Re: auto ref is on the docket

2015-06-22 Thread kinke via Digitalmars-d
On Monday, 22 June 2015 at 18:34:37 UTC, Namespace wrote: On Monday, 22 June 2015 at 18:03:43 UTC, Temtaime wrote: I see no reasons why « ref in » is bad. Maybe someone explain ? It's also natural for those who came from C++. In C++ there's no problem with const, so why they will be in D?

Re: auto ref is on the docket

2015-06-22 Thread Andrei Alexandrescu via Digitalmars-d
On 6/22/15 3:06 PM, Timon Gehr wrote: On 06/22/2015 06:11 AM, Andrei Alexandrescu wrote: Walter and I discussed what auto ref for templates should look like and reached the conclusion that an approach based on lowering would be best. I added a proposed lowering to

[Issue 14720] Template function reported as non-template

2015-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14720 --- Comment #2 from Yuxuan Shui yshu...@gmail.com --- Seems this bug is not related to nested templates at all, it's more likely an 'auto ref' bug: import std.traits, std.range; void a(S)(auto ref S i) { } void b(S)(auto ref S i) if

Re: Phobos addition formal review: std.experimental.allocator

2015-06-22 Thread Andrei Alexandrescu via Digitalmars-d
On 6/21/15 4:47 AM, Dicebot wrote: 6. Usage of ternary is not always clear / justified. In `IAllocator` it is explained and makes sense but there are things like http://erdani.com/d/phobos-prerelease/std_experimental_allocator_bitmapped_block.html (Ternary empty() - Returns true iff no memory is

Re: auto ref is on the docket

2015-06-22 Thread Jonathan M Davis via Digitalmars-d
On Monday, 22 June 2015 at 21:30:45 UTC, Daniel N wrote: On Monday, 22 June 2015 at 20:56:12 UTC, Jonathan M Davis wrote: won't mutate the argument, but if you allow it with ref in general, then you stand no chance of being able to look at a function signature and deduce whether the function

[Issue 14719] Template instantiation parsed as C-style type cast

2015-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14719 --- Comment #3 from Kenji Hara k.hara...@gmail.com --- (In reply to Yuxuan Shui from comment #2) First, (a!A) is not always a type, it can be a function or anything. Yes, it's not yet determined in parsing stage. The determination will be done in

Re: auto ref is on the docket

2015-06-22 Thread Jonathan M Davis via Digitalmars-d
On Monday, 22 June 2015 at 05:25:57 UTC, Walter Bright wrote: The idea is that fun(5) would be lowered to: auto tmp = 5; fun(tmp); That's not what Andrei described (though it's what I would have expected us to do). Rather, Andrei seems to be suggesting that having an auto ref

Re: This Week in D: Dconf Thursday summaries

2015-06-22 Thread Laeeth Isharc via Digitalmars-d-announce
On Thursday, 18 June 2015 at 12:51:12 UTC, Adam D. Ruppe wrote: I've done some COM stuff too, even interacting with vb and jscript through the IDispatch which I think will work in Excel too. I'm crazy busy the next few days, but here's the code: https://github.com/adamdruppe/com I have to

Re: auto ref is on the docket

2015-06-22 Thread Andrei Alexandrescu via Digitalmars-d
On 6/21/15 11:31 PM, Andrei Alexandrescu wrote: On 6/21/15 10:25 PM, Walter Bright wrote: The idea is that fun(5) would be lowered to: auto tmp = 5; fun(tmp); I don't think that lowering is recommended - it prolongs the lifetime of the temporary through the end of the caller. But

Re: PHP verses C#.NET verses D.

2015-06-22 Thread dennis luehring via Digitalmars-d
you should stay with PHP + C# or migrated to pure C# if you need to ask such a question here (without giving any infos about what the co-workers understand, the real size of the project is, etc.) Am 16.06.2015 um 01:53 schrieb Nick B: Hi. There is a startup in New Zealand that I have some

Re: Phobos addition formal review: std.experimental.allocator

2015-06-22 Thread Andrei Alexandrescu via Digitalmars-d
On 6/13/15 4:16 PM, ZombineDev wrote: On Saturday, 13 June 2015 at 15:48:31 UTC, Andrei Alexandrescu wrote: On 6/13/15 3:14 AM, Dicebot wrote: Andrei, have you considered creating additional std.allocator.impl package and moving actual allocators there? Or, probably, the other way around with

Re: auto ref is on the docket

2015-06-22 Thread Andrei Alexandrescu via Digitalmars-d
On 6/21/15 10:08 PM, Steven Schveighoffer wrote: On 6/22/15 12:11 AM, Andrei Alexandrescu wrote: Walter and I discussed what auto ref for templates You mean *non-templates*? auto ref for templates has a very well defined meaning. Yes, non-tempaltes. And reading your post, I'm unclear what

Does D has built-in stack structure?

2015-06-22 Thread Assembly via Digitalmars-d-learn
Does D has built-in stack structure (if so, which module?) or should I implement it myself?

Re: auto ref is on the docket

2015-06-22 Thread Jonathan M Davis via Digitalmars-d
On Monday, 22 June 2015 at 04:11:41 UTC, Andrei Alexandrescu wrote: Walter and I discussed what auto ref for templates should look like and reached the conclusion that an approach based on lowering would be best. I added a proposed lowering to

Re: std.collection - changing the collection while iterating

2015-06-22 Thread Andrei Alexandrescu via Digitalmars-d
On 6/21/15 10:03 PM, Steven Schveighoffer wrote: On 6/21/15 10:55 PM, Andrei Alexandrescu wrote: On 6/21/15 7:31 PM, Steven Schveighoffer wrote: On 6/21/15 7:02 PM, Andrei Alexandrescu wrote: While I work on making std.allocator better, here's some food for thought regarding std.collection.

Re: std.collection - changing the collection while iterating

2015-06-22 Thread Joseph Cassman via Digitalmars-d
On Sunday, 21 June 2015 at 23:02:38 UTC, Andrei Alexandrescu wrote: While I work on making std.allocator better, here's some food for thought regarding std.collection. Consider a traditional container with reference semantics, Java-style. Regarding changing the collection (e.g.

Re: auto ref is on the docket

2015-06-22 Thread Andrei Alexandrescu via Digitalmars-d
On 6/21/15 10:25 PM, Walter Bright wrote: On 6/21/2015 10:08 PM, Steven Schveighoffer wrote: On 6/22/15 12:11 AM, Andrei Alexandrescu wrote: Walter and I discussed what auto ref for templates You mean *non-templates*? auto ref for templates has a very well defined meaning. And reading your

Re: auto ref is on the docket

2015-06-22 Thread Andrei Alexandrescu via Digitalmars-d
On 6/21/15 11:11 PM, Jonathan M Davis wrote: No, that's not quite as nice a lowering, but it would avoid a lot of extraneous function definitions. I think a lowering is a must. Matters are complicated as they are, I don't want to add new rules. Combinatorial issues can be addressed by

Re: PHP verses C#.NET verses D.

2015-06-22 Thread Nick B via Digitalmars-d
On Thursday, 18 June 2015 at 03:44:08 UTC, Etienne Cimon wrote: On Wednesday, 17 June 2015 at 18:40:01 UTC, Laeeth Isharc wrote: Any idea how far away it might be from being something that someone could use in an enterprise environment simply, in the same kind of way that vibed is easy? I

Re: auto ref is on the docket

2015-06-22 Thread Jonathan M Davis via Digitalmars-d
On Monday, 22 June 2015 at 06:38:57 UTC, Andrei Alexandrescu wrote: On 6/21/15 11:31 PM, Andrei Alexandrescu wrote: On 6/21/15 10:25 PM, Walter Bright wrote: The idea is that fun(5) would be lowered to: auto tmp = 5; fun(tmp); I don't think that lowering is recommended - it prolongs

[Issue 14542] Table of contents in specification PDF is broken

2015-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14542 ag0ae...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 14542] Table of contents in specification PDF is broken

2015-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14542 --- Comment #4 from Vladimir Panteleev thecybersha...@gmail.com --- This was fixed just a few days ago: https://github.com/D-Programming-Language/dlang.org/pull/1024 --

[Issue 14719] Template instantiation parsed as C-style type cast

2015-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14719 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED

Re: dtiled v0.2 - a library for tilemapped games

2015-06-22 Thread Manu via Digitalmars-d-announce
Hey cool. I haven't thought about tiled for years! I contributed the terrain painting system years ago ;) Nice to see a lib in D! On 22 June 2015 at 13:45, rcorre via Digitalmars-d-announce digitalmars-d-announce@puremagic.com wrote: dtiled v0.2 is out, and for better or worse, it got hit by a

Re: This Week in D: Dconf Thursday summaries

2015-06-22 Thread Adam D. Ruppe via Digitalmars-d-announce
On Monday, 22 June 2015 at 06:01:35 UTC, Laeeth Isharc wrote: Do you have any thoughts on automating the generation of IDL files? I didn't need them, the mixin IDispatchImpl bit (example here: https://github.com/adamdruppe/com/blob/master/example/chello.d ) gave enough that the dynamic

[Issue 14718] float parsing depends on libc strtold precision

2015-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14718 --- Comment #3 from Martin Nowak c...@dawg.eu --- Sounds a lot like this glibc bug [14047 – strtof gives spurious ERANGE errors](https://sourceware.org/bugzilla/show_bug.cgi?id=14047) which got fixed with glibc 2.17. --

Re: Naming things

2015-06-22 Thread Mike via Digitalmars-d
On Saturday, 20 June 2015 at 09:27:16 UTC, Vladimir Panteleev wrote: Two examples of controversial name pairs: setExt/setExtension, and toLower/toLowerCase. These functions have the same functionality, but one of them is eager, and the other is lazy. Can you guess which is which? Yikes!

Re: type of a variable as a mixin-able string?

2015-06-22 Thread via Digitalmars-d-learn
On Sunday, 21 June 2015 at 23:25:47 UTC, Timothee Cour wrote: Suppose I have: import std.range; auto a=iota(complex_expr_returning_3()); I'd like to have a function/trait/template/compiler magic that takes variable a and generates a string that can be mixed in to represent the type of a. The

Re: color library

2015-06-22 Thread Rikki Cattermole via Digitalmars-d
On 22/06/2015 8:45 p.m., Andrea Fontana wrote: On Monday, 22 June 2015 at 08:08:42 UTC, Rikki Cattermole wrote: Why would IImage support alpha? Shouldn't that be on the color? If so, the PR does support it see RGBA8 and friends. I said on color or IImage. Anyway transparency is a property

Re: color library

2015-06-22 Thread Kagamin via Digitalmars-d
On Monday, 22 June 2015 at 08:45:38 UTC, Andrea Fontana wrote: They used to pack alpha informations with other pixel infos (color) just for simplicity and to have a convenient way to store info inside a file, I guess. Separate mask has an advantage of lower memory consumption: it can have

Re: std.math.isIdentical and NaN

2015-06-22 Thread Jonathan M Davis via Digitalmars-d
On Monday, 22 June 2015 at 08:10:20 UTC, Dan Olson wrote: Docs for isIdentical say: Same as ==, except that positive and negative zero are not identical, and two NANs are identical if they have the same 'payload'. However, it returns false for NaN's with different signbits but same

Re: Future(s) for D.

2015-06-22 Thread Jacob Carlborg via Digitalmars-d
On 22/06/15 01:43, Nick Sabalausky wrote: Curiosity, what libraries do you feel a lack of? For work, that would be: * Database drivers for Postgres and SQLite * ORM * Unit test framework. I want something like RSpec * RabbitMQ and ActiveMQ * Some way to interface with Selenium and PhantomJS

Re: Naming things

2015-06-22 Thread Wyatt via Digitalmars-d
On Saturday, 20 June 2015 at 09:27:16 UTC, Vladimir Panteleev wrote: Two examples of controversial name pairs: setExt/setExtension, and toLower/toLowerCase. These functions have the same functionality, but one of them is eager, and the other is lazy. Can you guess which is which If I had

Re: Naming things

2015-06-22 Thread Vladimir Panteleev via Digitalmars-d
On Monday, 22 June 2015 at 11:45:31 UTC, Wyatt wrote: On Saturday, 20 June 2015 at 09:27:16 UTC, Vladimir Panteleev wrote: Two examples of controversial name pairs: setExt/setExtension, and toLower/toLowerCase. These functions have the same functionality, but one of them is eager, and the

[Issue 14720] New: Template function reported non-template

2015-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14720 Issue ID: 14720 Summary: Template function reported non-template Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: normal

[Issue 14720] Template function reported non-template

2015-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14720 Yuxuan Shui yshu...@gmail.com changed: What|Removed |Added Keywords||diagnostic --

[Issue 14719] Template instantiation parsed as C-style type cast

2015-06-22 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14719 Yuxuan Shui yshu...@gmail.com changed: What|Removed |Added Keywords||diagnostic --

Re: color library

2015-06-22 Thread Rikki Cattermole via Digitalmars-d
On 22/06/2015 7:55 p.m., Andrea Fontana wrote: On Sunday, 21 June 2015 at 15:42:39 UTC, Rikki Cattermole wrote: interface IImage(COLOR) { @property { size_t width() @nogc nothrow; size_t height() @nogc nothrow; void* storage() @nogc nothrow; } COLOR

Re: color library

2015-06-22 Thread Andrea Fontana via Digitalmars-d
On Monday, 22 June 2015 at 08:08:42 UTC, Rikki Cattermole wrote: Why would IImage support alpha? Shouldn't that be on the color? If so, the PR does support it see RGBA8 and friends. I said on color or IImage. Anyway transparency is a property (mask) of an image (material) rather than of the

Re: color library

2015-06-22 Thread Tofu Ninja via Digitalmars-d
On Monday, 22 June 2015 at 08:45:38 UTC, Andrea Fontana wrote: On Monday, 22 June 2015 at 08:08:42 UTC, Rikki Cattermole wrote: I said on color or IImage. Anyway transparency is a property (mask) of an image (material) rather than of the color itself. A color has no transparency, there's no

Re: color library

2015-06-22 Thread Manu via Digitalmars-d
Hey cool. Glad to hear you had no problems. Sorry, I missed it. I had an early night last night (sunday night _) .. Are there recordings to review? It's an interesting idea; knowing if a colour is convertible to some other colour without loss... it sounds like it leads to implicit conversion, but

  1   2   >