Re: D on quora ...

2017-10-07 Thread user1234 via Digitalmars-d
On Saturday, 7 October 2017 at 18:31:46 UTC, user1234 wrote: On Saturday, 7 October 2017 at 15:12:08 UTC, Random D user wrote: Actually, Manual Memory Management is slow and D's GC is slower. Allocators should not work without an internal state. Damn...I meant the opposite, Allocators

Re: D on quora ...

2017-10-07 Thread user1234 via Digitalmars-d
On Saturday, 7 October 2017 at 15:12:08 UTC, Random D user wrote: Actually, Manual Memory Management is slow and D's GC is slower. Allocators should not work without an internal state. The fact that the heap chunk you get is mallocated or gcallocated shouldn't be a concern. The data

Re: isInputRange as a __traits ?

2017-10-07 Thread user1234 via Digitalmars-d
On Saturday, 7 October 2017 at 10:59:02 UTC, Jonathan M Davis wrote: On Saturday, October 07, 2017 10:46:05 user1234 via > Why? What would we gain from that? I've replied in another answer, so again, the idea is to save a bit of time spent to compile. I very much doubt Walter would consider

Re: isInputRange as a __traits ?

2017-10-07 Thread user1234 via Digitalmars-d
On Saturday, 7 October 2017 at 10:40:16 UTC, Jonathan M Davis wrote: On Saturday, October 07, 2017 10:31:01 user1234 via Digitalmars-d wrote: Since the compiler has the ability to detect input ranges in the foreach aggregate that are aggregates implementing the right primitives, why don't you

Re: isInputRange as a __traits ?

2017-10-07 Thread user1234 via Digitalmars-d
On Saturday, 7 October 2017 at 10:36:21 UTC, drug wrote: 07.10.2017 13:31, user1234 пишет: Since the compiler has the ability to detect input ranges in the foreach aggregate that are aggregates implementing the right primitives, why don't you set the widely used std.range.isInputRange as a

isInputRange as a __traits ?

2017-10-07 Thread user1234 via Digitalmars-d
Since the compiler has the ability to detect input ranges in the foreach aggregate that are aggregates implementing the right primitives, why don't you set the widely used std.range.isInputRange as a __trait, e.g __traits(isInputRange, Stuff) ?

Re: Eilmer4 - a Computational Fluid Dynamics code in D

2017-10-07 Thread user1234 via Digitalmars-d-announce
On Friday, 6 October 2017 at 22:16:09 UTC, Peter Jacobs wrote: Eilmer is a simulation code for studying high-speed compressible flows. Early versions were written in C and then C++. Version 4 is a complete rewrite in D, with Lua for configuration and run-time scripting. Code and

Re: Why does BinaryHeap sometime cause compile-error in foeach?

2017-09-30 Thread user1234 via Digitalmars-d-learn
On Saturday, 30 September 2017 at 09:27:23 UTC, Shigeki Karita wrote: https://dpaste.dzfl.pl/cd605899d050 why this code cannot convert to foreach (over Structs and Classes with Ranges). auto h = new BinaryHeap!(int[])(new int[0]); typeof(h).stringof.writeln; static

Re: D's SwitchStatement accepts statements with ridiculous semantics

2017-09-30 Thread user1234 via Digitalmars-d
On Friday, 29 September 2017 at 09:12:54 UTC, Don Clugston wrote: Or it may have just been an accident. But regardless of the original motivation, it allows some truly dreadful semantics. Can we disallow this silliness please? There are two big family of switches. C-like and Pascal like. In

Re: generating @property from structs

2017-09-30 Thread user1234 via Digitalmars-d-learn
On Saturday, 30 September 2017 at 08:20:44 UTC, Nicholas Wilson wrote: struct MyType { void* ptr; static struct Info { @(42) int foo; } // Should be generated by the mixin below @property int foo() { int ret;

Re: static this not run?

2017-09-30 Thread user1234 via Digitalmars-d-learn
On Saturday, 30 September 2017 at 06:15:41 UTC, Nicholas Wilson wrote: No "initialising onError", the static this is not even being run! I'm using LDC master. See also https://github.com/libmir/dcompute/issues/32 LDC 1.4, DMD 2.076, DMD ~master and finally GDC all give the expected result

Re: Is it possible to specify the address returned by the address of operator?

2017-09-28 Thread user1234 via Digitalmars-d-learn
On Thursday, 28 September 2017 at 00:11:56 UTC, DreadKyller wrote: On Wednesday, 27 September 2017 at 23:24:58 UTC, user1234 wrote: Notice how dereferencing the pointer did not call the overloaded function, because a pointer to Test is not the same type as a Test. Yeah, this is rather made

Re: Is it possible to specify the address returned by the address of operator?

2017-09-27 Thread user1234 via Digitalmars-d-learn
On Wednesday, 27 September 2017 at 21:01:36 UTC, Jesse Phillips wrote: On Wednesday, 27 September 2017 at 16:35:54 UTC, DreadKyller wrote: My question is about overloading, several operators can be overloaded in D, one of the ones that can't apparently is the address of operator (). My

Re: Should we add `a * b` for vectors?

2017-09-24 Thread user1234 via Digitalmars-d
On Monday, 25 September 2017 at 01:08:35 UTC, Nicholas Wilson wrote: There's nothing stopping someone writing a DIP to include `@` (and possibly `#`) as overloadable binary operators. All other characters on the standard keyboard are used I think. ̣̣§

Re: 100,000th thread on the NG

2017-09-24 Thread user1234 via Digitalmars-d
On Sunday, 24 September 2017 at 04:24:55 UTC, user1234 wrote: This is the 100,000th Thread. A few hours ago, i was letting my mind flying. What if i were a professor. What would i tell about D... " We reach the end of this short course. Next time we'll see us you'll be tested. This test

Re: Finding class template instantiations via runtime reflection (for openmethods)

2017-09-23 Thread user1234 via Digitalmars-d
On Friday, 22 September 2017 at 12:16:52 UTC, Steven Schveighoffer wrote: On 9/21/17 4:32 PM, Jean-Louis Leroy wrote: It did not take long! Someone tried to create templatized open methods and it didn't work right of the box. I expected that, but in fact there may be a bit of hope. You cannot

100,000th thread on the NG

2017-09-23 Thread user1234 via Digitalmars-d
This is the 100,000th Thread.

Re: Why isn't there more if(__ctfe) in std.math ?

2017-09-23 Thread user1234 via Digitalmars-d-learn
On Saturday, 23 September 2017 at 18:23:12 UTC, Juraj Mojzis wrote: Hi, browsing trough phobos bugzilla I found a couple of open issues regarding CTFE and basic math functions ( Issue 4177, 5227). It looks to me that at least floor/ceil could by fixed by a simple: if (__ctfe) return

Re: Problems with function as parameter

2017-09-22 Thread user1234 via Digitalmars-d-learn
On Friday, 22 September 2017 at 04:32:08 UTC, Josh wrote: As an aside, in that doc it says "The .funcptr property of a delegate will return the function pointer value as a function type". So I also tried Mix_ChannelFinished(().funcptr); and this compiled, but caused a segfault when the

Re: cannot access frame of function

2017-09-18 Thread user1234 via Digitalmars-d-learn
On Monday, 18 September 2017 at 18:49:54 UTC, ag0aep6g wrote: On 09/18/2017 08:25 PM, user1234 wrote: On Monday, 18 September 2017 at 14:45:25 UTC, Alex wrote: [...] import std.algorithm.iteration : sum, cumulativeFold; void main() { double[5] a; [...]>> auto asum = a[].sum; [...]

Re: cannot access frame of function

2017-09-18 Thread user1234 via Digitalmars-d-learn
On Monday, 18 September 2017 at 14:45:25 UTC, Alex wrote: Hi all, given this code: import std.algorithm.iteration : sum, cumulativeFold; void main() { double[5] a; a = 0; foreach(el; a) assert(el == 0); a[0] = 1.0; a[1] = 2.0; a[2] = 3.0;

Re: D-Man emoji

2017-09-11 Thread user1234 via Digitalmars-d
On Monday, 11 September 2017 at 23:01:06 UTC, Walter Bright wrote: Here are some D-Man cartoons: https://github.com/dlang/dlang.org/pull/1648 which we sometimes use to decorate D related web pages: http://dlang.org/safed.html http://dlang.org/dstyle.html It seems we are under-utilizing our

Re: Performance Issue

2017-09-06 Thread user1234 via Digitalmars-d-learn
On Tuesday, 5 September 2017 at 09:44:09 UTC, Vino.B wrote: Hi, The below code is consume more memory and slower can you provide your suggestion on how to over come these issues. string[][] csizeDirList (string FFs, int SizeDir) { ulong subdirTotal = 0; ulong subdirTotalGB;

Re: dispatcher

2017-09-06 Thread user1234 via Digitalmars-d-learn
On Wednesday, 6 September 2017 at 05:57:18 UTC, Psychological Cleanup wrote: I have a C callback that must call some functions declared in D. I can't call them off the C thread because it will result in a violation. What is a good way to dispatch the call to the main D program? I'm thinking

Re: dub projects generate docs and host on code.dlang.org?

2017-09-05 Thread user1234 via Digitalmars-d
On Tuesday, 5 September 2017 at 02:08:08 UTC, Manu wrote: On 4 September 2017 at 21:45, user1234 via Digitalmars-d < digitalmars-d@puremagic.com> wrote: On Monday, 4 September 2017 at 10:47:47 UTC, Manu wrote: Thoughts? - Manu It has existed in the past, see http://forum.dlang.org/

Re: Struct with float members in betterC

2017-09-05 Thread user1234 via Digitalmars-d-learn
On Tuesday, 5 September 2017 at 11:58:18 UTC, Azi Hassan wrote: Hi, I'm trying to create the following struct in betterC but I keep getting undefined reference errors when I try to compile the code : [...] I'm aware that betterC is still experimental at this point, but I thought I'd ask

Re: dub projects generate docs and host on code.dlang.org?

2017-09-04 Thread user1234 via Digitalmars-d
On Monday, 4 September 2017 at 10:47:47 UTC, Manu wrote: I've seen a lot of dub projects with embedded ddoc that follows phobos example. These projects are then hosted on code.dlang.org, but often, the docs are never generated and hosted anywhere. In the event they are, links to docs are

Re: Template substitution for function parameters

2017-09-01 Thread user1234 via Digitalmars-d-learn
On Friday, 1 September 2017 at 10:15:09 UTC, Nicholas Wilson wrote: So I have the following types ... i.e. it substitutes the template DevicePointer for the template Buffer in Parameters!foo, The templates can be assumed to not be nested templates, i.e. DevicePointer!(DevicePointer!(float))

Re: testing for deprecation

2017-08-29 Thread user1234 via Digitalmars-d-learn
On Tuesday, 29 August 2017 at 05:03:39 UTC, Sebastien Alaiwan wrote: On Thursday, 1 September 2016 at 11:11:15 UTC, Cauterite wrote: How does one test whether a symbol is deprecated? I would have expected something like: __traits(isDeprecated, foo). Such a trait makes it possible to write

Re: Editor recommendations for new users.

2017-08-28 Thread user1234 via Digitalmars-d
On Sunday, 27 August 2017 at 12:14:18 UTC, Ecstatic Coder wrote: If it's to learn D programming, then I strongly advice CoEdit (despite I think that Geany's automatic brace insertion and copy paste features work MUCH better). For learning D but also if you program **only** in D. When the

Re: Beta 2.076.0

2017-08-26 Thread user1234 via Digitalmars-d-announce
On Saturday, 26 August 2017 at 12:33:44 UTC, Martin Nowak wrote: On 08/24/2017 09:40 PM, user1234 wrote: I have a warning about the RPM package signature. It was already the case with 2.075.1 Please be so kind to file a bug report (https://issues.dlang.org/) with a few more details and at

Re: 2 Dimensional Array Sorting

2017-08-26 Thread user1234 via Digitalmars-d-learn
On Saturday, 26 August 2017 at 09:53:44 UTC, Vino.B wrote: On Saturday, 26 August 2017 at 06:12:57 UTC, user1234 wrote: [...] Hi, I tired you logic, but doesn't seem to be working, as every time i execute the order of the file list is different as in the below program i have used the sort

Re: testing for deprecation

2017-08-26 Thread user1234 via Digitalmars-d-learn
On Friday, 25 August 2017 at 20:35:52 UTC, jmh530 wrote: On Thursday, 1 September 2016 at 11:13:42 UTC, rikki cattermole wrote: That is a first that somebody wanted it. Bug report please! I just ran across this with deprecated { void foo(); } void main() { pragma(msg,

Re: Compile Imported Modules

2017-08-26 Thread user1234 via Digitalmars-d
On Friday, 25 August 2017 at 19:20:15 UTC, Jonathan Marler wrote: On Friday, 25 August 2017 at 13:15:35 UTC, Daniel N wrote: On Friday, 25 August 2017 at 13:03:11 UTC, Jonathan Marler wrote: I can do: dmd -ci prog.d -Isomelib -Ianotherlib I love it, thanks for doing this! Thanks, I think

Re: pipeProcess not returning immediately

2017-08-26 Thread user1234 via Digitalmars-d-learn
On Saturday, 26 August 2017 at 01:13:35 UTC, Johnson Jones wrote: I am running ffplay.exe and my application does not return immediately from pipeProcess. I have to close ffplay for my program to continue execution. No process is asynchronous in std.process. If you don't want to block your

Re: 2 Dimensional Array Sorting

2017-08-26 Thread user1234 via Digitalmars-d-learn
On Saturday, 26 August 2017 at 06:11:37 UTC, user1234 wrote: On Saturday, 26 August 2017 at 06:01:15 UTC, Vino.B wrote: Hi, Can someone provide me a example of sorting 2 Dimensional Array containing Filename and Size, and should be sorted by Size. From, Vino.B void main(string[] args) {

Re: 2 Dimensional Array Sorting

2017-08-26 Thread user1234 via Digitalmars-d-learn
On Saturday, 26 August 2017 at 06:01:15 UTC, Vino.B wrote: Hi, Can someone provide me a example of sorting 2 Dimensional Array containing Filename and Size, and should be sorted by Size. From, Vino.B void main(string[] args) { import std.stdio; import std.algorithm.sorting;

Re: D IDE Coedit - version 3, update 3 released

2017-08-24 Thread user1234 via Digitalmars-d-announce
On Friday, 14 July 2017 at 06:10:08 UTC, Basile B. wrote: Better integration of D-Scanner. D-Scanner binary is itself included from now, in addition to DCD. See https://github.com/BBasile/Coedit/releases/tag/3_update_3 for the download links and a complete changelog. update 4 is available

Re: Beta 2.076.0

2017-08-24 Thread user1234 via Digitalmars-d-announce
On Friday, 18 August 2017 at 12:58:18 UTC, Martin Nowak wrote: First beta for the 2.076.0 release. This release comes with various phobos additions and lots of improvements for -betterC (changelog entry upcoming). http://dlang.org/download.html#dmd_beta

Re: Fix D's segfaults!

2017-08-20 Thread user1234 via Digitalmars-d
On Sunday, 20 August 2017 at 20:20:30 UTC, Jonathan M Davis wrote: On Sunday, August 20, 2017 12:35:45 Ali Çehreli via Digitalmars-d wrote: On 08/20/2017 12:14 PM, Johnson Jones wrote: >>> Dmd needs to be modified so that errors try to show from the source >>> code. This should be obvious

Re: Beta 2.076.0

2017-08-18 Thread user1234 via Digitalmars-d-announce
On Friday, 18 August 2017 at 16:52:51 UTC, Martin Nowak wrote: On 08/18/2017 02:58 PM, Martin Nowak wrote: First beta for the 2.076.0 release. This release comes with various phobos additions and lots of improvements for -betterC (changelog entry upcoming). This release will also come with

Re: Why modules is so strongly limited?

2016-07-14 Thread user1234 via Digitalmars-d
On Wednesday, 13 July 2016 at 20:58:02 UTC, imbaFireFenix wrote: Why modules is so strongly limited ? Because this are like that.

Re: UDAs on enum members

2016-07-13 Thread user1234 via Digitalmars-d
On Wednesday, 13 July 2016 at 11:57:21 UTC, Tomer Filiba wrote: It would be really nice if I could put UDAs on enum members as well, e.g., enum MyEnum { @("SOM") SomeMember, @("ANO") AnotherMemberWithAVeryLongName, } I can think of many reasons why that would be desired, but the

<    1   2   3   4