[Issue 17456] [REG2.075a] spurious lifetime diagnostic on delegates

2017-05-30 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17456 b2.t...@gmx.com changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution|---

Re: DCompute is now in the master branch of LDC

2017-05-30 Thread H. S. Teoh via Digitalmars-d-announce
On Tue, May 30, 2017 at 07:23:42PM +, Jack Stouffer via Digitalmars-d-announce wrote: > On Tuesday, 30 May 2017 at 18:06:56 UTC, Walter Bright wrote: > > I fear the conversation will go like this, like it has for me: > > > > N: DCompute > > W: What's DCompute? > > N: Enables GPU

Re: ushort calls byte overload

2017-05-30 Thread Daniel Kozak via Digitalmars-d-learn
Dne 30.5.2017 v 23:16 Oleg B via Digitalmars-d-learn napsal(a): Hello. I have this code import std.stdio; void foo(byte a) { writeln(typeof(a).stringof); } void foo(short a) { writeln(typeof(a).stringof); } void foo(int a) { writeln(typeof(a).stringof); } void main() { foo(0); // int,

Re: Value closures (no GC allocation)

2017-05-30 Thread deadalnix via Digitalmars-d
On Sunday, 21 May 2017 at 00:33:30 UTC, Vittorio Romeo wrote: Hello everyone, I recently started learning D (I come from a Modern C++ background) and I was curious about closures that require GC allocation. I wrote this simple example: auto bar(T)(T x) @nogc { return x(10);

Re: A Few thoughts on C, C++, and D

2017-05-30 Thread aberba via Digitalmars-d
On Tuesday, 30 May 2017 at 15:50:01 UTC, Swoorup Joshi wrote: On Tuesday, 30 May 2017 at 15:06:19 UTC, Jacob Carlborg wrote: On 2017-05-30 14:27, Ola Fosheim Grøstad wrote: Maybe even turning some macros into functions? DStep can do that today. How difficult is it to turn C++ headers

Re: howto count lines - fast

2017-05-30 Thread Daniel Kozak via Digitalmars-d-learn
I do not know this is my first attempt and it is almost same fast as wc on my pc: int main(string[] args) { import std.stdio : writeln, writefln, File; import std.array : uninitializedArray; auto f = File("data"); size_t c = 0; auto buffer =

[Issue 17456] [REG2.075a] spurious lifetime diagnostic on delegates

2017-05-30 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17456 Vladimir Panteleev changed: What|Removed |Added CC|

Re: abstract class information

2017-05-30 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, May 30, 2017 22:13:54 Wulfklaue via Digitalmars-d wrote: > I am just looking up abstract class information and i notice that > there is no information on dlang.org/spec > > Yet using this as a resource: > > https://www.tutorialspoint.com/d_programming/d_programming_abstract_classe >

[Issue 17456] [REG2.075a] spurious lifetime diagnostic on delegates

2017-05-30 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17456 b2.t...@gmx.com changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|INVALID

[Issue 17453] I Have Many Issues

2017-05-30 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17453 --- Comment #5 from Soar --- (In reply to Rainer Schuetze from comment #4) > > when i create a project,has > > myproject/core/exception.d directory and file hierarchy > > > and im write a module in a file like "module winmain;" > >

howto count lines - fast

2017-05-30 Thread Nitram via Digitalmars-d-learn
After reading https://dlang.org/blog/2017/05/24/faster-command-line-tools-in-d/ , i was wondering how fast one can do a simple "wc -l" in D. So i made a couple short implementations and found myself confronted with slow results compared to "/usr/bin/wc -l". How would a implementation look

Re: Faster Command Line Tools in D

2017-05-30 Thread Steven Schveighoffer via Digitalmars-d-announce
On 5/26/17 10:41 AM, John Colvin wrote: On Wednesday, 24 May 2017 at 13:39:57 UTC, Mike Parker wrote: Some of you may remember Jon Degenhardt's talk from one of the Silicon Valley D meetups, where he described the performance improvements he saw when he rewrote some of eBay's command line tools

Re: Faster Command Line Tools in D

2017-05-30 Thread Steven Schveighoffer via Digitalmars-d-announce
On 5/26/17 11:20 AM, John Colvin wrote: On Friday, 26 May 2017 at 14:41:39 UTC, John Colvin wrote: I spent some time fiddling with my own manual approaches to making this as fast, wasn't satisfied and so decided to try using Steven's iopipe (https://github.com/schveiguy/iopipe) instead. Results

Re: std.functional.memoize : thread local or __gshared memoization?

2017-05-30 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, May 30, 2017 19:00:12 Kagamin via Digitalmars-d wrote: > On Saturday, 27 May 2017 at 16:27:46 UTC, Ola Fosheim Grøstad > > wrote: > > If the semantics in C is that everything is typed shared then > > it should also be treated as such when D interfaces with C and > > C like

Re: Faster Command Line Tools in D

2017-05-30 Thread Patrick Schluter via Digitalmars-d-announce
On Tuesday, 30 May 2017 at 21:18:42 UTC, Steven Schveighoffer wrote: On 5/26/17 11:20 AM, John Colvin wrote: On Friday, 26 May 2017 at 14:41:39 UTC, John Colvin wrote: [...] This version also has the advantage of being (discounting any bugs in iopipe) correct for arbitrary unicode in all

Re: A Few thoughts on C, C++, and D

2017-05-30 Thread Jonathan M Davis via Digitalmars-d
On Monday, May 29, 2017 13:58:54 Brad Roberts via Digitalmars-d wrote: > On 5/29/2017 1:36 PM, Moritz Maxeiner via Digitalmars-d wrote: > > On Monday, 29 May 2017 at 17:09:21 UTC, aberba wrote: > >> IMO, the most important thing is getting the job done. > > > > * getting the job done right. > >

Re: abstract class information

2017-05-30 Thread Moritz Maxeiner via Digitalmars-d
On Tuesday, 30 May 2017 at 22:13:54 UTC, Wulfklaue wrote: I am just looking up abstract class information and i notice that there is no information on dlang.org/spec They are defined where the abstract attribute is defined[1], but there is not much to them. [1]

Re: DCompute is now in the master branch of LDC

2017-05-30 Thread Daniel Kozak via Digitalmars-d-announce
Dne 30.5.2017 v 21:23 Jack Stouffer via Digitalmars-d-announce napsal(a): On Tuesday, 30 May 2017 at 18:06:56 UTC, Walter Bright wrote: I fear the conversation will go like this, like it has for me: N: DCompute W: What's DCompute? N: Enables GPU programming with D W: Cool! instead of:

Re: howto count lines - fast

2017-05-30 Thread Jordan Wilson via Digitalmars-d-learn
On Tuesday, 30 May 2017 at 20:37:44 UTC, Jordan Wilson wrote: On Tuesday, 30 May 2017 at 20:02:38 UTC, Nitram wrote: After reading https://dlang.org/blog/2017/05/24/faster-command-line-tools-in-d/ , i was wondering how fast one can do a simple "wc -l" in D. So i made a couple short

Re: ushort calls byte overload

2017-05-30 Thread Oleg B via Digitalmars-d-learn
and this is unexpected for me too immutable ushort y = 0; foo(y); // byte

ushort calls byte overload

2017-05-30 Thread Oleg B via Digitalmars-d-learn
Hello. I have this code import std.stdio; void foo(byte a) { writeln(typeof(a).stringof); } void foo(short a) { writeln(typeof(a).stringof); } void foo(int a) { writeln(typeof(a).stringof); } void main() { foo(0); // int, and byte if not define foo(int) foo(ushort(0)); // byte

[Issue 17448] Move semantics cause memory corruption and cryptic bugs

2017-05-30 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17448 --- Comment #11 from Walter Bright --- One possibility is to not allow escaping references to 'this' in @safe constructors. --

[Issue 17448] Move semantics cause memory corruption and cryptic bugs

2017-05-30 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17448 --- Comment #10 from Andrei Alexandrescu --- (In reply to Shachar Shemesh from comment #9) > There are two issues here. The first is that @safe does not warn about > unsafe behavior. Affirmative. > Interesting, but unrelated to

Re: A Few thoughts on C, C++, and D

2017-05-30 Thread Ola Fosheim Grøstad via Digitalmars-d
On Tuesday, 30 May 2017 at 19:12:28 UTC, Jacob Carlborg wrote: Currently DStep cannot handle #if or #ifdef. Oh, that is often required… What were the objections to integration with DMD? I don't recall exactly, I recommend reading the post I linked to [1]. My impression is that there is

Re: howto count lines - fast

2017-05-30 Thread Jordan Wilson via Digitalmars-d-learn
On Tuesday, 30 May 2017 at 20:02:38 UTC, Nitram wrote: After reading https://dlang.org/blog/2017/05/24/faster-command-line-tools-in-d/ , i was wondering how fast one can do a simple "wc -l" in D. So i made a couple short implementations and found myself confronted with slow results compared

abstract class information

2017-05-30 Thread Wulfklaue via Digitalmars-d
I am just looking up abstract class information and i notice that there is no information on dlang.org/spec Yet using this as a resource: https://www.tutorialspoint.com/d_programming/d_programming_abstract_classes.htm It can be found, with a proper example. Am i blind and not seeing it in

Re: Faster Command Line Tools in D

2017-05-30 Thread Steven Schveighoffer via Digitalmars-d-announce
On 5/30/17 5:57 PM, Patrick Schluter wrote: On Tuesday, 30 May 2017 at 21:18:42 UTC, Steven Schveighoffer wrote: On 5/26/17 11:20 AM, John Colvin wrote: On Friday, 26 May 2017 at 14:41:39 UTC, John Colvin wrote: [...] This version also has the advantage of being (discounting any bugs in

Re: howto count lines - fast

2017-05-30 Thread Stanislav Blinov via Digitalmars-d-learn
On Tuesday, 30 May 2017 at 23:41:01 UTC, H. S. Teoh wrote: This little challenge piqued my interest. So I decided to take a shot at seeing if I could beat my system's /usr/bin/wc -l. First order of business: whenever it comes to performance, always choose the right compiler for the job...

Re: Rosetta Commatizing numbers

2017-05-30 Thread Jordan Wilson via Digitalmars-d-learn
On Tuesday, 30 May 2017 at 10:54:49 UTC, Solomon E wrote: The earlier version of the page made D look more error prone than other languages, but short. Now my solution is as long as some of the other language's solutions, but it's well commented and tested, I think. Now I doubt any of the

Re: howto count lines - fast

2017-05-30 Thread H. S. Teoh via Digitalmars-d-learn
P.S. After I posted the code, I took a closer look at the disassembly and found that gdc wasn't generating the best code for the parallel foreach loop body. I haven't fully traced the cause yet, but I did find a simple optimization (arguably a micro-optimization): updating the subtotal inside the

Re: Silicon Valley D Meetup - May 25, 2017 - "Trip reports: DConf 2017 and C++Now 2017"

2017-05-30 Thread Nicholas Wilson via Digitalmars-d-announce
On Thursday, 25 May 2017 at 07:53:16 UTC, Ali Çehreli wrote: We have guests Martin Nowak, Dentcho Bankov, and Georgi Dimitrov in person: https://www.meetup.com/D-Lang-Silicon-Valley/events/240129190/ Ali How'd this go?

Re: howto count lines - fast

2017-05-30 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, May 30, 2017 at 08:02:38PM +, Nitram via Digitalmars-d-learn wrote: > After reading > https://dlang.org/blog/2017/05/24/faster-command-line-tools-in-d/ , i > was wondering how fast one can do a simple "wc -l" in D. > > So i made a couple short implementations and found myself

Re: howto count lines - fast

2017-05-30 Thread Ali Çehreli via Digitalmars-d-learn
On 05/30/2017 01:02 PM, Nitram wrote: After reading https://dlang.org/blog/2017/05/24/faster-command-line-tools-in-d/ , i was wondering how fast one can do a simple "wc -l" in D. So i made a couple short implementations and found myself confronted with slow results compared to "/usr/bin/wc -l".

Re: Silicon Valley D Meetup - May 25, 2017 - "Trip reports: DConf 2017 and C++Now 2017"

2017-05-30 Thread Ali Çehreli via Digitalmars-d-announce
On 05/30/2017 06:18 PM, Nicholas Wilson wrote: On Thursday, 25 May 2017 at 07:53:16 UTC, Ali Çehreli wrote: We have guests Martin Nowak, Dentcho Bankov, and Georgi Dimitrov in person: https://www.meetup.com/D-Lang-Silicon-Valley/events/240129190/ Ali How'd this go? It turned into a

[Issue 17448] Move semantics cause memory corruption and cryptic bugs

2017-05-30 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17448 --- Comment #12 from Walter Bright --- Interestingly, if you change: auto f() { return CallContext(18); } to: auto f() { CallContext c = CallContext(18); return c; } it will work, i.e. no moving is

Re: [OT] I-frame cutting in H.264

2017-05-30 Thread Era Scarecrow via Digitalmars-d
On Tuesday, 30 May 2017 at 11:32:21 UTC, Marco Leise wrote: Ok, but even then your source material would ideally have to be encoded with the same codec and parameters. A different resolution would not work, while a change in frame rate is tolerable. I agree, however when VirtualDub barfs,

Re: DCompute is now in the master branch of LDC

2017-05-30 Thread Brad Anderson via Digitalmars-d-announce
On Monday, 29 May 2017 at 20:36:26 UTC, Walter Bright wrote: May I suggest, however, that the name DCompute is a bit generic, and provides no hint that it provides GPU programming for D. How about calling it D-GPU ? I bet you'd get a lot more clicks on a name like that. For what it's

Re: Another "D is cool" post

2017-05-30 Thread Mike Parker via Digitalmars-d
On Tuesday, 30 May 2017 at 05:14:21 UTC, H. S. Teoh wrote: OK, this is the 3rd or 4th time somebody asked about this. What exactly is involved in making a post on the D blog? Hopefully it would not require too much more effort, because I usually wouldn't have much time to spend on top of

Re: A Few thoughts on C, C++, and D

2017-05-30 Thread Wulfklaue via Digitalmars-d
On Tuesday, 30 May 2017 at 07:15:08 UTC, Russel Winder wrote: Others have mentioned widening D's appeal by widening the number of C APIs there are wrappers for. This is a good idea, I agree – in my case libdvbv5 and librtlsdr are the beasties of interest. I argue Deimos is the wrong direction

[Issue 17454] ABI non-conformity: produces unaligned placement of struct on stack

2017-05-30 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17454 --- Comment #5 from Manu --- So, you're saying that MSVC is passing an output pointer as first arg? I'll try and confirm that. I didn't see that happening. --

[Issue 17455] New: [Functions] Incorrect description of "in" storage class.

2017-05-30 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17455 Issue ID: 17455 Summary: [Functions] Incorrect description of "in" storage class. Product: D Version: D2 Hardware: All URL: http://dlang.org/ OS:

Re: A Few thoughts on C, C++, and D

2017-05-30 Thread Jacob Carlborg via Digitalmars-d
On 2017-05-29 18:08, Russel Winder via Digitalmars-d wrote: My biggest problem of the moment is libdvbv5 and librtlsdr. DStep seemingly cannot help as yet. I know you have reported a few bugs for DStep. Are those all or anything else that has not been reported yet? -- /Jacob Carlborg

Re: DCompute is now in the master branch of LDC

2017-05-30 Thread Manu via Digitalmars-d-announce
On 30 May 2017 at 16:00, Brad Anderson via Digitalmars-d-announce < digitalmars-d-announce@puremagic.com> wrote: > On Monday, 29 May 2017 at 20:36:26 UTC, Walter Bright wrote: > >> >> May I suggest, however, that the name DCompute is a bit generic, and >> provides no hint that it provides GPU

Re: binding to C++

2017-05-30 Thread Oleksii via Digitalmars-d-learn
On Friday, 26 May 2017 at 15:17:08 UTC, drug wrote: Trying to bind to cpp code I stop at some moment having undefined reference to some cpp function. But objdump -Ct cpplibrary.so shows me that this cpp function exists in the library. linker message about cpp function is _identical_ to

Re: purity question

2017-05-30 Thread Rene Zwanenburg via Digitalmars-d-learn
On Monday, 29 May 2017 at 01:36:24 UTC, Jonathan M Davis wrote: A simple example: anything that has a malloc/free pair. Yeah, if you do it right, you should be fine, but you have to do it right, and it's very easy to miss some detail that makes it wrong to insist to the compiler that what

Re: Should out/ref parameters require the caller to specify out/ref like in C#?

2017-05-30 Thread via Digitalmars-d
On Tuesday, 30 May 2017 at 09:48:09 UTC, Petar Kirov [ZombineDev] wrote: On Tuesday, 30 May 2017 at 06:13:39 UTC, Stanislav Blinov wrote: On Tuesday, 30 May 2017 at 02:12:56 UTC, Jonathan M Davis wrote: That definition currently there is more precise than the definition on that page has been

[Issue 17454] ABI non-conformity: produces unaligned placement of struct on stack

2017-05-30 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17454 Walter Bright changed: What|Removed |Added CC|

Re: A Few thoughts on C, C++, and D

2017-05-30 Thread Ola Fosheim Grøstad via Digitalmars-d
On Tuesday, 30 May 2017 at 07:56:43 UTC, Wulfklaue wrote: Its been my firm believe that lose packages are a detriment to a language. It isn't good if many of the interesting packages are unmaintained, as it gives an sense of being in the past. Half baked solutions are no solutions. Packages

Re: [Semi-OT] DoS with hashing

2017-05-30 Thread Kagamin via Digitalmars-d
The attack relies on many collisions. I wonder if it would be enough to just count the number of collisions and rehash the hashtable with new hash seed on some threshold number.

Re: Should out/ref parameters require the caller to specify out/ref like in C#?

2017-05-30 Thread via Digitalmars-d
On Tuesday, 30 May 2017 at 06:13:39 UTC, Stanislav Blinov wrote: On Tuesday, 30 May 2017 at 02:12:56 UTC, Jonathan M Davis wrote: That definition currently there is more precise than the definition on that page has been historically... Apparently, it is not. Do you have a reference to

Re: Should out/ref parameters require the caller to specify out/ref like in C#?

2017-05-30 Thread Stanislav Blinov via Digitalmars-d
On Tuesday, 30 May 2017 at 02:12:56 UTC, Jonathan M Davis wrote: That definition currently there is more precise than the definition on that page has been historically... Apparently, it is not. Do you have a reference to Walter's change regarding `in` becoming just `const`? Because a change

[Issue 17454] ABI non-conformity: produces unaligned placement of struct on stack

2017-05-30 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17454 Jacob Carlborg changed: What|Removed |Added CC||d...@me.com --- Comment #3

Re: A Few thoughts on C, C++, and D

2017-05-30 Thread Russel Winder via Digitalmars-d
On Tue, 2017-05-30 at 08:39 +0200, Jacob Carlborg via Digitalmars-d wrote: > On 2017-05-29 18:08, Russel Winder via Digitalmars-d wrote: > > > My biggest problem of the moment is libdvbv5 and librtlsdr. DStep > > seemingly cannot help as yet. > > I know you have reported a few bugs for DStep.

Re: GPGPU progess

2017-05-30 Thread Nicholas Wilson via Digitalmars-d
On Thursday, 18 May 2017 at 05:39:52 UTC, Manu wrote: How far are we from integration into LDC without using forked compilers? The future is now! https://forum.dlang.org/thread/zcfqujlgnultnqfks...@forum.dlang.org

[Issue 17454] ABI non-conformity: produces unaligned placement of struct on stack

2017-05-30 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17454 --- Comment #2 from Walter Bright --- > d_fun returns a struct by value which appears by looking at the disassembly > that d_fun allocates room for the result value on it's stack, and then > returns a pointer to the

Re: Another "D is cool" post

2017-05-30 Thread qznc via Digitalmars-d
On Tuesday, 30 May 2017 at 05:14:21 UTC, H. S. Teoh wrote: On Tue, May 30, 2017 at 01:44:58AM +, Mike Parker via Digitalmars-d wrote: On Monday, 29 May 2017 at 19:51:26 UTC, David Gileadi wrote: > On 5/29/17 12:07 PM, H. S. Teoh via Digitalmars-d wrote: > > [snip an excellent post] > I

Re: Another "D is cool" post

2017-05-30 Thread Walter Bright via Digitalmars-d
On 5/29/2017 6:44 PM, Mike Parker wrote: On Monday, 29 May 2017 at 19:51:26 UTC, David Gileadi wrote: On 5/29/17 12:07 PM, H. S. Teoh via Digitalmars-d wrote: [snip an excellent post] I think a longish post like this would make an excellent shortish post for the D blog. Yes, please. I

Re: GPGPU progess

2017-05-30 Thread Manu via Digitalmars-d
On 30 May 2017 at 17:33, Nicholas Wilson via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > On Thursday, 18 May 2017 at 05:39:52 UTC, Manu wrote: > >> How far are we from integration into LDC without using forked compilers? >> > > The future is now! > >

Re: "Programming in D" is up-to-date

2017-05-30 Thread Wulfklaue via Digitalmars-d-announce
On Monday, 29 May 2017 at 23:08:55 UTC, Ali Çehreli wrote: Makes sense and others had suggested that as well. One complication would be different cover design for each book. (Even if not the general concept, the book cover image is for that specific number of pages (with some leeway)). I

[Issue 17454] ABI non-conformity: produces unaligned placement of struct on stack

2017-05-30 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17454 --- Comment #4 from Manu --- > What does happen is d_fun()'s caller allocates S, and then passes a pointer > to S to d_fun(), and d_fun() fills it in and returns that pointer to S. Interesting... so, what is __HID1 as

Re: GPGPU progess

2017-05-30 Thread Nicholas Wilson via Digitalmars-d
On Tuesday, 30 May 2017 at 08:14:16 UTC, Manu wrote: On 30 May 2017 at 17:33, Nicholas Wilson via Digitalmars-d < digitalmars-d@puremagic.com> wrote: On Thursday, 18 May 2017 at 05:39:52 UTC, Manu wrote: How far are we from integration into LDC without using forked compilers? The future

Re: Error: func(const(A) a) is not callable using argument types (const(A)

2017-05-30 Thread Andrew Edwards via Digitalmars-d-learn
Sorry, rough day. Could someone please explain what this means and how do go about resolving it? Thanks, Andrew

Re: Error: func(const(A) a) is not callable using argument types (const(A)

2017-05-30 Thread Biotronic via Digitalmars-d-learn
On Tuesday, 30 May 2017 at 10:09:50 UTC, Andrew Edwards wrote: What does that even mean? Scenario: bool func(const ImVec2 label_size) { return true; } void main() { //first attempt: const ImVec2 label_size = CalcTextSize(label.ptr, null, true); //Error: cannot implicitly

[OT] I-frame cutting in H.264

2017-05-30 Thread Marco Leise via Digitalmars-d
Am Sat, 27 May 2017 22:19:11 + schrieb Era Scarecrow : > Only if you have to recompress it. Some tools like VirutalDub > allow you to chop and copy without altering the data stream (it's > good for taking out commercials or shortening clips). Although I > wouldn't be

Re: A Few thoughts on C, C++, and D

2017-05-30 Thread Ola Fosheim Grøstad via Digitalmars-d
On Tuesday, 30 May 2017 at 12:26:22 UTC, Ola Fosheim Grøstad wrote: What happend to that Calypso project? I suppose libclang also would allow you to inspect C header-files and then maybe it would be possible to synthesize Dish bindings from it on the fly? Not that I have given it much

Error: func(const(A) a) is not callable using argument types (const(A)

2017-05-30 Thread Andrew Edwards via Digitalmars-d-learn
What does that even mean? Scenario: bool func(const ImVec2 label_size) { return true; } void main() { //first attempt: const ImVec2 label_size = CalcTextSize(label.ptr, null, true); //Error: cannot implicitly convert expression (CalcTextSize(cast(immutable(char)*)label, null,

Re: Error: func(const(A) a) is not callable using argument types (const(A)

2017-05-30 Thread Daniel Kozak via Digitalmars-d-learn
It seems there are two different ImVec2 types. So ImVec2 is not same as ImVec2 :) On Tue, May 30, 2017 at 12:09 PM, Andrew Edwards via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: > What does that even mean? > > Scenario: > > bool func(const ImVec2 label_size) > { > return

Re: Error: func(const(A) a) is not callable using argument types (const(A)

2017-05-30 Thread Biotronic via Digitalmars-d-learn
On Tuesday, 30 May 2017 at 10:31:24 UTC, Daniel Kozak wrote: import std.traits : fqn = fullyQualifiedName; Darnit. I just googled the template and got a result talking about fqn!T. So yeah - this code: import std.traits; pragma(msg, fullyQualifiedName!ImVec2); pragma(msg,

Re: Error: func(const(A) a) is not callable using argument types (const(A)

2017-05-30 Thread Biotronic via Digitalmars-d-learn
On Tuesday, 30 May 2017 at 10:46:12 UTC, Andrew Edwards wrote: On Tuesday, 30 May 2017 at 10:37:58 UTC, Biotronic wrote: On Tuesday, 30 May 2017 at 10:31:24 UTC, Daniel Kozak wrote: import std.traits : fqn = fullyQualifiedName; Darnit. I just googled the template and got a result talking

Re: purity question

2017-05-30 Thread ketmar via Digitalmars-d-learn
Rene Zwanenburg wrote: On Monday, 29 May 2017 at 01:36:24 UTC, Jonathan M Davis wrote: A simple example: anything that has a malloc/free pair. Yeah, if you do it right, you should be fine, but you have to do it right, and it's very easy to miss some detail that makes it wrong to insist to

Re: DCompute is now in the master branch of LDC

2017-05-30 Thread Nicholas Wilson via Digitalmars-d-announce
On Tuesday, 30 May 2017 at 08:16:06 UTC, Manu wrote: I kinda wanted to add a +1 here too; I read 'compute' used as a noun(-ish) Ah, isn't English wonderful. I guess Walter is suffering the inverse of the Calvin & Hobbes "Verbing nouns weirds the language", nouning verbs does weird the

Re: Error: func(const(A) a) is not callable using argument types (const(A)

2017-05-30 Thread Nicholas Wilson via Digitalmars-d-learn
On Tuesday, 30 May 2017 at 10:20:53 UTC, Andrew Edwards wrote: Sorry, rough day. Could someone please explain what this means and how do go about resolving it? Thanks, Andrew If you want to resolve it just do const label_size = CalcTextSize(...); but as others have mentioned make sure

Re: Built-in RAII in D

2017-05-30 Thread qznc via Digitalmars-d
On Sunday, 28 May 2017 at 18:50:02 UTC, Nerve wrote: On Sunday, 28 May 2017 at 18:38:21 UTC, Moritz Maxeiner wrote: All in all, I see little to no benefit to what you propose, while requiring significant work on the language spec. Point taken. My only remaining reservation then is the

Re: Error: func(const(A) a) is not callable using argument types (const(A)

2017-05-30 Thread Andrew Edwards via Digitalmars-d-learn
On Tuesday, 30 May 2017 at 10:37:58 UTC, Biotronic wrote: On Tuesday, 30 May 2017 at 10:31:24 UTC, Daniel Kozak wrote: import std.traits : fqn = fullyQualifiedName; Darnit. I just googled the template and got a result talking about fqn!T. So yeah - this code: import std.traits;

Re: A Few thoughts on C, C++, and D

2017-05-30 Thread Russel Winder via Digitalmars-d
And in good news, despite Dub's inability to understand the way things are on Debian, and using some egregious hacks, I have a DStep build on Debian Sid that appears to work. No such luck on Fedora but that is a "known issue" for DStep (*). It seems libdvbv5 D wrapper generation may be working.

Re: DCompute is now in the master branch of LDC

2017-05-30 Thread piotrklos via Digitalmars-d-announce
On Tuesday, 30 May 2017 at 06:00:57 UTC, Brad Anderson wrote: On Monday, 29 May 2017 at 20:36:26 UTC, Walter Bright wrote: May I suggest, however, that the name DCompute is a bit generic, and provides no hint that it provides GPU programming for D. How about calling it D-GPU ? I bet you'd

Rosetta Commatizing numbers

2017-05-30 Thread Solomon E via Digitalmars-d-learn
I ran into a Rosetta code solution in D that had obvious errors. It's like the author or the previous editor wasn't even trying to do it right, like a protest against how many detailed rules the task had. I assumed that's not the way we want to do things in D. Then I spent all day fixing it.

Re: A Few thoughts on C, C++, and D

2017-05-30 Thread bachmeier via Digitalmars-d
On Tuesday, 30 May 2017 at 05:50:13 UTC, Ola Fosheim Grostad wrote: Focusing on getting many libraries won't work, because you need to maintain them. I never use unmaintained libraries... Having many unmaintained libraries is in a way worse than having a few long-running ones that improve at

Re: Should out/ref parameters require the caller to specify out/ref like in C#?

2017-05-30 Thread Stanislav Blinov via Digitalmars-d
On Tuesday, 30 May 2017 at 09:55:14 UTC, Petar Kirov [ZombineDev] wrote: Unfortunately, `in` was never implemented as `scope const`. I think it was only when Walter started working actively on scope that he found out that it's too late to change this - https://github.com/dlang/dmd/pull/5898.

Re: Error: func(const(A) a) is not callable using argument types (const(A)

2017-05-30 Thread Daniel Kozak via Digitalmars-d-learn
http://forum.dlang.org/post/xpmpakmusudanwuzz...@forum.dlang.org https://issues.dlang.org/show_bug.cgi?id=9631 On Tue, May 30, 2017 at 1:07 PM, Biotronic via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: > On Tuesday, 30 May 2017 at 10:46:12 UTC, Andrew Edwards wrote: > >> On

Re: Best way for handle missing args in REST interface in vibed

2017-05-30 Thread Suliman via Digitalmars-d-learn
I had post question here http://forum.rejectedsoftware.com/groups/rejectedsoftware.vibed/thread/43511/

Re: A Few thoughts on C, C++, and D

2017-05-30 Thread Wulfklaue via Digitalmars-d
On Tuesday, 30 May 2017 at 11:22:29 UTC, bachmeier wrote: One of the things I hated when I started using D was links to dsource libraries. I think that writing new libraries in D is often a mistake for that very reason. Bindings to C libraries is what we need. Put everything into one D file if

Re: [OT] I-frame cutting in H.264

2017-05-30 Thread Guillaume Piolat via Digitalmars-d
On Tuesday, 30 May 2017 at 11:32:21 UTC, Marco Leise wrote: So unless you know that every I-frame is an IDR in your sources it is not advisable to use them as cut points. I'll assume that Sociomantic doesn't have the original video source. Pretty much what Marco Leise said. While video

Re: Error: func(const(A) a) is not callable using argument types (const(A)

2017-05-30 Thread Daniel Kozak via Digitalmars-d-learn
import std.traits : fqn = fullyQualifiedName; On Tue, May 30, 2017 at 12:24 PM, Biotronic via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: > On Tuesday, 30 May 2017 at 10:09:50 UTC, Andrew Edwards wrote: > >> What does that even mean? >> >> Scenario: >> >> bool func(const

Re: A Few thoughts on C, C++, and D

2017-05-30 Thread Ola Fosheim Grøstad via Digitalmars-d
On Tuesday, 30 May 2017 at 11:22:29 UTC, bachmeier wrote: One of the things I hated when I started using D was links to dsource libraries. I think that writing new libraries in D is often a mistake for that very reason. Bindings to C libraries is what we need. Put everything into one D file if

Re: abstract class information

2017-05-30 Thread ag0aep6g via Digitalmars-d
On 05/31/2017 12:19 AM, Jonathan M Davis via Digitalmars-d wrote: Note that marking a class as abstract is equivalent to marking all of its member functions with abstract, just like marking class with @safe would make all of its member functions @safe. So, there isn't really any special handling

Re: ushort calls byte overload

2017-05-30 Thread nkm1 via Digitalmars-d-learn
On Tuesday, 30 May 2017 at 21:16:26 UTC, Oleg B wrote: Hello. I have this code import std.stdio; void foo(byte a) { writeln(typeof(a).stringof); } void foo(short a) { writeln(typeof(a).stringof); } void foo(int a) { writeln(typeof(a).stringof); } void main() { foo(0); // int, and byte if

Re: Rosetta Commatizing numbers

2017-05-30 Thread Ivan Kazmenko via Digitalmars-d-learn
On Tuesday, 30 May 2017 at 10:54:49 UTC, Solomon E wrote: I ran into a Rosetta code solution in D that had obvious errors. It's like the author or the previous editor wasn't even trying to do it right, like a protest against how many detailed rules the task had. I assumed that's not the way we

Re: Rosetta Commatizing numbers

2017-05-30 Thread Ivan Kazmenko via Digitalmars-d-learn
On Wednesday, 31 May 2017 at 04:31:14 UTC, Ivan Kazmenko wrote: Now, where is the old version wrong? ... Actually, it also changes every number in the string, not only the first one as required. Because of that, it also fails the "do not touch the exponent" requirement. Sadly, both are

Re: purity question

2017-05-30 Thread ketmar via Digitalmars-d-learn
Rene Zwanenburg wrote: On Tuesday, 30 May 2017 at 11:34:52 UTC, ketmar wrote: If malloc were marked as pure, wouldn't that mean it must return the same pointer every time you call it with the same size? of course. but D "pure" is not what other world knows as "pure". we love to mess with

Re: purity question

2017-05-30 Thread Rene Zwanenburg via Digitalmars-d-learn
On Tuesday, 30 May 2017 at 11:34:52 UTC, ketmar wrote: If malloc were marked as pure, wouldn't that mean it must return the same pointer every time you call it with the same size? of course. but D "pure" is not what other world knows as "pure". we love to mess with words. Well, there's the

Re: A Few thoughts on C, C++, and D

2017-05-30 Thread Jacob Carlborg via Digitalmars-d
On 2017-05-30 14:27, Ola Fosheim Grøstad wrote: Maybe even turning some macros into functions? DStep can do that today. -- /Jacob Carlborg

Re: A Few thoughts on C, C++, and D

2017-05-30 Thread Ola Fosheim Grostad via Digitalmars-d
On Tuesday, 30 May 2017 at 15:06:19 UTC, Jacob Carlborg wrote: On 2017-05-30 14:27, Ola Fosheim Grøstad wrote: Maybe even turning some macros into functions? DStep can do that today. That's cool! How robust is in practice on typical header files (i.e zlib and similar)? What were the

Re: Built-in RAII in D

2017-05-30 Thread Mike Parker via Digitalmars-d
On Tuesday, 30 May 2017 at 10:30:13 UTC, qznc wrote: Currently, a good answer is to direct people to the "Don't fear the reaper" [0] article, but I feel it does not really address all concerns of people. Concerns like: That was the introductory post in what I hope will be a long series

Re: A Few thoughts on C, C++, and D

2017-05-30 Thread Jacob Carlborg via Digitalmars-d
On 2017-05-30 14:26, Ola Fosheim Grøstad wrote: What happend to that Calypso project? I suppose libclang also would allow you to inspect C header-files and then maybe it would be possible to synthesize Dish bindings from it on the fly? Not that I have given it much thought. I did that by

Re: purity question

2017-05-30 Thread Biotronic via Digitalmars-d-learn
On Tuesday, 30 May 2017 at 13:45:07 UTC, Rene Zwanenburg wrote: On Tuesday, 30 May 2017 at 11:34:52 UTC, ketmar wrote: If malloc were marked as pure, wouldn't that mean it must return the same pointer every time you call it with the same size? of course. but D "pure" is not what other world

Re: DCompute is now in the master branch of LDC

2017-05-30 Thread Atila Neves via Digitalmars-d-announce
On Tuesday, 30 May 2017 at 12:21:02 UTC, piotrklos wrote: On Tuesday, 30 May 2017 at 06:00:57 UTC, Brad Anderson wrote: On Monday, 29 May 2017 at 20:36:26 UTC, Walter Bright wrote: [...] For what it's worth, I see "Compute" used all the time to refer to this stuff. OpenCL stands for Open

Re: Another "D is cool" post

2017-05-30 Thread Jacob Carlborg via Digitalmars-d
On 2017-05-30 07:14, H. S. Teoh via Digitalmars-d wrote: OK, this is the 3rd or 4th time somebody asked about this. What exactly is involved in making a post on the D blog? Hopefully it would not require too much more effort, because I usually wouldn't have much time to spend on top of the

Re: purity question

2017-05-30 Thread ag0aep6g via Digitalmars-d-learn
On 05/30/2017 11:12 AM, Rene Zwanenburg wrote: If malloc were marked as pure, wouldn't that mean it must return the same pointer every time you call it with the same size? D's `pure` mostly means: "does not access mutable state, and does not do input/output". There is never a requirement

Re: Should out/ref parameters require the caller to specify out/ref like in C#?

2017-05-30 Thread Andrei Alexandrescu via Digitalmars-d
On 05/30/2017 05:48 AM, Petar Kirov [ZombineDev] wrote: On Tuesday, 30 May 2017 at 06:13:39 UTC, Stanislav Blinov wrote: On Tuesday, 30 May 2017 at 02:12:56 UTC, Jonathan M Davis wrote: That definition currently there is more precise than the definition on that page has been historically...

  1   2   >