Re: Release D 2.089.0

2019-11-04 Thread John Chapman via Digitalmars-d-announce
On Sunday, 3 November 2019 at 13:35:36 UTC, Martin Nowak wrote: Glad to announce D 2.089.0, ♥ to the 44 contributors. This release comes with corrected extern(C) mangling in mixin templates, atomicFetchAdd and atomicFetchSub in core.atomic, support for link driver arguments, better support of

Re: ... use of ... is hidden by ...; use alias ... to introduce base class overload set ??

2019-10-21 Thread John Chapman via Digitalmars-d-learn
On Sunday, 20 October 2019 at 21:45:35 UTC, Robert M. Münch wrote: class myWidget : Observer!message {...} class FilterSubject : SubjectObject!message { Disposable subscribe(myWidget observer){...} } I tried to add "alias subscribe = SubjectObject.subscribe;" in different places, but that

Re: A proper WAT moment

2019-10-15 Thread John Colvin via Digitalmars-d-learn
On Monday, 14 October 2019 at 19:45:11 UTC, Paul Backus wrote: On Monday, 14 October 2019 at 17:00:56 UTC, John Colvin wrote: Different ability to access a property depending if I'm inside something else when I look? [snip] You're attempting to call one of S's member functions without

A proper WAT moment

2019-10-14 Thread John Colvin via Digitalmars-d-learn
Different ability to access a property depending if I'm inside something else when I look? struct S { int a; static int b; int c() { return a; } static int d() { return 3; } int e() @property { return a; } static int f() @property { return 3; } } void foo(S s) {

How to find what is causing a closure allocation

2019-10-02 Thread John Colvin via Digitalmars-d-learn
I have a function that allocates a closure somewhere in it (as shown by the result of -profile=gc). I can't make the function nogc as it calls a lot of other GC using code. profilegc.log only gives me the line number of the function signature, which doesn't give me any hint as to where in

Re: Abstract classes vs interfaces, casting from void*

2019-08-11 Thread John Colvin via Digitalmars-d-learn
On Sunday, 11 August 2019 at 20:15:34 UTC, Alex wrote: On Sunday, 11 August 2019 at 16:05:20 UTC, John Colvin wrote: I'm trying to narrow down exactly what patterns work with each and how they overlap. What I was trying to get at with the abstract method thing is that abstract class C

Re: Abstract classes vs interfaces, casting from void*

2019-08-11 Thread John Colvin via Digitalmars-d-learn
On Sunday, 11 August 2019 at 15:16:03 UTC, Alex wrote: On Sunday, 11 August 2019 at 13:09:43 UTC, John Colvin wrote: Ok. What would go wrong (in D) if I just replaced every interface with an abstract class? I think there's some confusion here, because B.foo is not abstract. abstract

Re: Abstract classes vs interfaces, casting from void*

2019-08-11 Thread John Colvin via Digitalmars-d-learn
On Saturday, 10 August 2019 at 17:28:32 UTC, Alex wrote: ´´´ void main(){} interface A { void fun(); } abstract class B{ void fun(); } class C : A{ void fun(){} } class D : B{ /*override*/ void fun(){} } ´´´ case 1: interface A and class C implementing interface A: You don't need to "override"

Re: Abstract classes vs interfaces, casting from void*

2019-08-11 Thread John Colvin via Digitalmars-d-learn
On Saturday, 10 August 2019 at 17:46:37 UTC, Timon Gehr wrote: On 10.08.19 16:29, John Colvin wrote: Ok. What would go wrong (in D) if I just replaced every interface with an abstract class? interface A{} interface B{} class C: A,B{ } Yes, I know, I guess it wasn't clear unless you read

Re: Abstract classes vs interfaces, casting from void*

2019-08-10 Thread John Colvin via Digitalmars-d-learn
On Saturday, 10 August 2019 at 10:11:15 UTC, Alex wrote: On Saturday, 10 August 2019 at 08:20:46 UTC, John Colvin wrote: On Friday, 9 August 2019 at 13:39:53 UTC, Simen Kjærås wrote: Thanks for the extra detail. Is there a solid reason to ever use an interface over an abstract class

Re: Abstract classes vs interfaces, casting from void*

2019-08-10 Thread John Colvin via Digitalmars-d-learn
On Saturday, 10 August 2019 at 10:02:02 UTC, Antonio Corbi wrote: On Saturday, 10 August 2019 at 08:20:46 UTC, John Colvin wrote: On Friday, 9 August 2019 at 13:39:53 UTC, Simen Kjærås wrote: Thanks for the extra detail. Is there a solid reason to ever use an interface over an abstract

Re: Abstract classes vs interfaces, casting from void*

2019-08-10 Thread John Colvin via Digitalmars-d-learn
On Friday, 9 August 2019 at 13:39:53 UTC, Simen Kjærås wrote: Thanks for the extra detail. Is there a solid reason to ever use an interface over an abstract class? (Other than multiple inheritance). I'm such a noob at anything related to OO.

Re: Abstract classes vs interfaces, casting from void*

2019-08-10 Thread John Colvin via Digitalmars-d-learn
On Friday, 9 August 2019 at 13:39:53 UTC, Simen Kjærås wrote: We're getting into somewhat advanced topics now. This is described in the Application Binary Interface page of the documentation[0]. In short: classes and interfaces both use a vtable[1] that holds pointers to each of their methods.

Re: Abstract classes vs interfaces, casting from void*

2019-08-09 Thread John Colvin via Digitalmars-d-learn
On Friday, 9 August 2019 at 13:19:14 UTC, kinke wrote: On Friday, 9 August 2019 at 12:26:59 UTC, John Colvin wrote: Why is there no "hi" between 0 and 1? Because you are treating the unadjusted object pointer as interface pointer and then call the only virtual function of that

Abstract classes vs interfaces, casting from void*

2019-08-09 Thread John Colvin via Digitalmars-d-learn
import std.stdio; interface I { void foo(); } class C : I { override void foo() { writeln("hi"); } } abstract class AC { void foo(); } class D : AC { override void foo() { writeln("hi"); } } void main() { auto c = new C(); writeln(0); (cast(I)cast(void*)c).foo();

Re: Symantec has been sold to Broadcom

2019-08-08 Thread John Carter via Digitalmars-d-announce
On Thursday, 8 August 2019 at 23:46:38 UTC, Walter Bright wrote: It's the end of an era. Symantec bought my company, Zortech, and now is bought in return. The D community, and myself personally, owe a debt of gratitude to Symantec. You were lucky... ...in another age of the world they

Re: bolts meta programming library version 1.0.0 - including the from idiom

2019-07-16 Thread John Colvin via Digitalmars-d-announce
On Tuesday, 16 July 2019 at 18:18:50 UTC, Atila Neves wrote: On Tuesday, 16 July 2019 at 00:10:19 UTC, Aliak wrote: On Monday, 15 July 2019 at 21:20:16 UTC, Atila Neves wrote: On Monday, 15 July 2019 at 11:13:10 UTC, aliak wrote: I've been using a set of meta tools for a while now, so decided

Re: DConf 2019 Slides

2019-05-13 Thread John Carter via Digitalmars-d-announce
On Wednesday, 8 May 2019 at 08:50:15 UTC, Mike Parker wrote: Jens Mueller is speaking after Walter. His slides can be found here: Thanks for what you are doing here, I have looked at them all! Is there a video and/or slides for Walter's keynote anywhere?

Re: Compiler/Phobos/Types problem — panic level due to timing.

2019-05-09 Thread John Colvin via Digitalmars-d-learn
On Wednesday, 8 May 2019 at 11:53:34 UTC, Russel Winder wrote: On Mon, 2019-05-06 at 15:53 +, John Colvin via Digitalmars-d-learn wrote: […] pretty please show people it with UFCS: recurrence!((a, n) => a[n-1] + a[n-2])(zero, one) .dropExactly(n) .front Any particular rea

Re: Compiler/Phobos/Types problem — panic level due to timing.

2019-05-06 Thread John Colvin via Digitalmars-d-learn
On Monday, 6 May 2019 at 13:05:27 UTC, Russel Winder wrote: On Sunday, 5 May 2019 at 19:34:05 UTC, Nicholas Wilson wrote: On Sunday, 5 May 2019 at 19:18:47 UTC, lithium iodate wrote: [...] Yep https://run.dlang.io/is/XsLrRz works for me, https://run.dlang.io/is/KxY0e9 doesn't. Thanks

Re: Handling big FP numbers

2019-02-08 Thread John via Digitalmars-d-learn
On Saturday, 9 February 2019 at 02:12:29 UTC, Murilo wrote: Why is it that in C when I attribute the number 991234307654329925.7865 to a double it prints 991234299470108672. and in D it prints 9912342990. ? Apparently both languages cause a certain loss

Re: What is the alternative to the setlocale function of c in D? Thank you.

2019-01-28 Thread John Chapman via Digitalmars-d-learn
On Sunday, 27 January 2019 at 16:23:42 UTC, FrankLike wrote: On Sunday, 27 January 2019 at 10:44:04 UTC, John Chapman wrote: On Sunday, 27 January 2019 at 06:14:15 UTC, FrankLike wrote: On Saturday, 26 January 2019 at 09:33:33 UTC, John Chapman wrote: What has that code got to do

Re: What is the alternative to the setlocale function of c in D? Thank you.

2019-01-27 Thread John Chapman via Digitalmars-d-learn
On Sunday, 27 January 2019 at 06:14:15 UTC, FrankLike wrote: On Saturday, 26 January 2019 at 09:33:33 UTC, John Chapman wrote: What has that code got to do with setting the console's font? So you need to add more code to accomplish that. You don't need to set the font to achieve the goal

Re: What is the alternative to the setlocale function of c in D? Thank you.

2019-01-26 Thread John Chapman via Digitalmars-d-learn
On Saturday, 26 January 2019 at 06:03:25 UTC, FrankLike wrote: On Friday, 25 January 2019 at 15:05:50 UTC, John Chapman wrote: On Friday, 25 January 2019 at 14:23:15 UTC, FrankLike wrote: I need to set the font by the code now, because I need to do the installer, can't let this installer set

Re: What is the alternative to the setlocale function of c in D? Thank you.

2019-01-25 Thread John Chapman via Digitalmars-d-learn
On Friday, 25 January 2019 at 14:23:15 UTC, FrankLike wrote: I need to set the font by the code now, because I need to do the installer, can't let this installer set the properties on each computer? SetCurrentConsoleFontEx perhaps?

Re: Is there a nice syntax to achieve optional named parameters?

2019-01-21 Thread John Burton via Digitalmars-d-learn
On Monday, 21 January 2019 at 07:57:58 UTC, Simen Kjærås wrote: On Saturday, 19 January 2019 at 14:26:31 UTC, Zenw wrote: On Tuesday, 15 January 2019 at 11:14:54 UTC, John Burton wrote: [...] how about this auto With(string code,T)(T value) { with(value) { mixin(code

Re: Is there a nice syntax to achieve optional named parameters?

2019-01-18 Thread John Burton via Digitalmars-d-learn
On Thursday, 17 January 2019 at 01:43:42 UTC, SrMordred wrote: struct Config { string title; int width; } struct Window { this(Config config) It likely is a bad idea for a small struct like this but if it was much bigger would it makes sense to write this as :-

Re: Is there a nice syntax to achieve optional named parameters?

2019-01-17 Thread John Burton via Digitalmars-d-learn
On Wednesday, 16 January 2019 at 14:59:01 UTC, Kagamin wrote:> On Tuesday, 15 January 2019 at 11:14:54 UTC, John Burton wrote: auto window = Window(title = "My Window", width = 1000, fullscreen = true); In this particular case I would make the constructor take 3 parameters -

Re: Is there a nice syntax to achieve optional named parameters?

2019-01-17 Thread John Burton via Digitalmars-d-learn
On Thursday, 17 January 2019 at 01:43:42 UTC, SrMordred wrote: On Tuesday, 15 January 2019 at 11:14:54 UTC, John Burton wrote: [...] Let me throw this idea here: struct Config { string title; int width; } struct Window { this(Config config

B Revzin - if const expr isn't broken (was Re: My Meeting C++ Keynote video is now available)

2019-01-16 Thread John Carter via Digitalmars-d-announce
On Saturday, 12 January 2019 at 15:51:03 UTC, Andrei Alexandrescu wrote: https://youtube.com/watch?v=tcyb1lpEHm0 Now as to the talk, as you could imagine, it touches on another Somebody on the C++ side has written a reply

Re: Is there a nice syntax to achieve optional named parameters?

2019-01-16 Thread John Burton via Digitalmars-d-learn
On Wednesday, 16 January 2019 at 11:21:53 UTC, Dukc wrote: On Tuesday, 15 January 2019 at 11:14:54 UTC, John Burton wrote: This is ok, but I'm not so keen on separating the creation and construction like this. Is there a better way that's not ugly? You can make the constructor a template

Re: Is there a nice syntax to achieve optional named parameters?

2019-01-15 Thread John Burton via Digitalmars-d-learn
On Tuesday, 15 January 2019 at 12:15:41 UTC, rikki cattermole wrote: On 16/01/2019 1:05 AM, John Burton wrote: On Tuesday, 15 January 2019 at 11:26:50 UTC, rikki cattermole wrote: Longer term, you're better off with the builder. Thanks for your reply. But what is the builder? https

Re: Is there a nice syntax to achieve optional named parameters?

2019-01-15 Thread John Burton via Digitalmars-d-learn
On Tuesday, 15 January 2019 at 11:26:50 UTC, rikki cattermole wrote: Longer term, you're better off with the builder. Thanks for your reply. But what is the builder? Creating windows is a very complex task that can balloon in scope. Well that was mostly just an example that I thought

Is there a nice syntax to achieve optional named parameters?

2019-01-15 Thread John Burton via Digitalmars-d-learn
As an example let's say I have a type 'Window' that represents a win32 window. I'd like to be able to construct an instance of the type with some optional parameters that default to some reasonable settings and create the underlying win32 window. I'd ideally like some syntax like this :-

Re: How to split strings into AA using phobos

2018-12-11 Thread John Chapman via Digitalmars-d-learn
On Tuesday, 11 December 2018 at 08:20:32 UTC, Arun Chandrasekaran wrote: A typical example would be to split the HTTP query string into an AA. vibe.d has req.queryString, but no convenient wrapper to access it as an AA. http://localhost/hello?name=abc=123 I've got this far. auto

Re: ElementType of MapResult is a delegate??

2018-12-08 Thread John Chapman via Digitalmars-d-learn
On Saturday, 8 December 2018 at 13:02:00 UTC, Yuxuan Shui wrote: This surprised me A LOT: https://d.godbolt.org/z/82a_GZ So if I call something.map!().array, I get an array of delegates? That makes no sense to me. But in your example, "(a) =>" returns "{return tmp;}", which is a delegate.

Ambiguous virtual function

2018-12-05 Thread John Chapman via Digitalmars-d-learn
I get an "ambiguous virtual function" error when I compile this: interface I { void fun(); } mixin template F() { void fun() {} } class C : I { mixin F; mixin F; } But the error doesn't occur with this: class C : I { mixin F; void fun() {} } Is the

Re: DirectXMath alternative

2018-12-05 Thread John Burton via Digitalmars-d-learn
On Wednesday, 5 December 2018 at 10:52:44 UTC, Guillaume Piolat wrote: On Wednesday, 5 December 2018 at 01:57:53 UTC, evilrat wrote: On Tuesday, 4 December 2018 at 20:41:54 UTC, Guillaume Piolat wrote: [...] I was using gl3n then switched to gfm math. Try gfm, IIRC it should work without

Re: DirectXMath alternative

2018-12-04 Thread John Burton via Digitalmars-d-learn
On Wednesday, 5 December 2018 at 01:57:53 UTC, evilrat wrote: On Tuesday, 4 December 2018 at 20:41:54 UTC, Guillaume Piolat wrote: On Tuesday, 4 December 2018 at 20:33:07 UTC, John Burton wrote: What is the best alternative for D, assuming there is anything? (I want vector, matrix math for use

DirectXMath alternative

2018-12-04 Thread John Burton via Digitalmars-d-learn
There is a directx-d library which seems to work nicely for d3d11 but it doesn't include anything like DirectXMath.h presumably because it's all implemented as inline intrinsics and very visual c++ specific. What is the best alternative for D, assuming there is anything? (I want vector,

Re: Function signature as string

2018-11-29 Thread John Chapman via Digitalmars-d-learn
On Thursday, 29 November 2018 at 21:31:57 UTC, Neia Neutuladh wrote: On Thu, 29 Nov 2018 21:11:06 +, John Chapman wrote: Is there any way to get a string representing a function's exact signature as declared in the source? I can generate it myself using reflection but it might not be 100

Function signature as string

2018-11-29 Thread John Chapman via Digitalmars-d-learn
Is there any way to get a string representing a function's exact signature as declared in the source? I can generate it myself using reflection but it might not be 100% verbatim so wanted to know if there's anything built in? foreach (m; __traits(allMembers, T)) { alias member =

Re: How to center dlangui Window on screen

2018-11-29 Thread John Chapman via Digitalmars-d-learn
On Thursday, 29 November 2018 at 13:42:28 UTC, greatsam4sure wrote: Which class in dlangui is use to obtain the screen height and width? A Windom of dimension 280 x 445 in dlangui is the same as a Windom of 350 x 550 in Javafx and adobe air. What could be responsible for this wide difference?

Re: Making external types available to mixins

2018-11-24 Thread John Chapman via Digitalmars-d-learn
On Friday, 23 November 2018 at 21:49:55 UTC, Kagamin wrote: Well, just have all factories in one module and import it, then they will be visible. They're part of another library over which I have no control, but yes, I could still import them all and make life easier. import allfactories;

Re: memoize & __traits(compiles...)

2018-11-23 Thread John Chapman via Digitalmars-d-learn
On Friday, 23 November 2018 at 11:29:24 UTC, Nicholas Wilson wrote: No, std.functional.memoize uses a hashtable to cache the runtime results of calls to expensive functions. assuming that the example is not oversimplified and generateFunc1 and generateFunc2 are functions, the compiler

memoize & __traits(compiles...)

2018-11-23 Thread John Chapman via Digitalmars-d-learn
I'm doing a fair amount of repeatedly checking if a function compiles with __traits(compiles...), executing the function if so, erroring out if not, like this: static if (__traits(compiles, generateFunc1())) { return generateFunc1(); } static if (__traits(compiles, generateFunc2())) {

Re: Making external types available to mixins

2018-11-23 Thread John Chapman via Digitalmars-d-learn
On Thursday, 22 November 2018 at 16:27:08 UTC, Eduard Staniloiu wrote: So I had a go at this and I have a working solution. https://run.dlang.io/is/oaH6Ib At first, I tried to do everything in the mixin, as you can see with the `failedAttempt` function. The idea was that this should have

Re: task can't take a class method

2018-11-19 Thread John Chapman via Digitalmars-d-learn
On Monday, 19 November 2018 at 16:29:01 UTC, helxi wrote: On Monday, 19 November 2018 at 16:10:15 UTC, helxi wrote: ... Oh wait never mind I was missing a bracket: auto proc = task!(ddCall.dd()); Now I have another thing to worry about: ddcall.dd() cannot be read at compile

Re: Making external types available to mixins

2018-11-18 Thread John Chapman via Digitalmars-d-learn
On Saturday, 17 November 2018 at 21:11:38 UTC, Adam D. Ruppe wrote: On Saturday, 17 November 2018 at 17:58:54 UTC, John Chapman wrote: Has anyone had a similar need and come up with a solution? You might be able to just pass it the Calendar type, and then fetch its parent module and get

Making external types available to mixins

2018-11-17 Thread John Chapman via Digitalmars-d-learn
The following code doesn't compile because the generated type name needs to be available inside the mixin's scope, whereas it's actually in another module. auto makeWith(string className, Args…)(auto ref Args args) { mixin("return makeWith!(I", className, "Factory)(args);"); // Fowarded to

Re: Profiling DMD's Compilation Time with dmdprof

2018-11-08 Thread John Chapman via Digitalmars-d-announce
On Thursday, 8 November 2018 at 20:19:47 UTC, Vladimir Panteleev wrote: On Thursday, 8 November 2018 at 19:07:32 UTC, Jacob Carlborg wrote: 21 seconds on a Windows 10 virtual machine compiling using the win32.mak file. Sounds like we're narrowing it down to the Visual Studio solution.

Re: Accessing LPARAM param from SendMessage acts weird.

2018-11-04 Thread John Chapman via Digitalmars-d-learn
On Sunday, 4 November 2018 at 19:06:22 UTC, Mark Moorhen wrote: Another Windows challenge: I'm trying to get the title of the active window even if it is from an external application. This is what I've come up with so far: import std.stdio; import core.sys.windows.windows; extern

Re: DirectX bindings

2018-10-30 Thread John Burton via Digitalmars-d-learn
On Tuesday, 30 October 2018 at 10:46:35 UTC, Mike Parker wrote: On Tuesday, 30 October 2018 at 10:30:48 UTC, John Burton wrote: I want to do some graphics using direct3d11 on windows. There are some bindings that I used once before https://github.com/evilrat666/directx-d However

DirectX bindings

2018-10-30 Thread John Burton via Digitalmars-d-learn
I want to do some graphics using direct3d11 on windows. There are some bindings that I used once before https://github.com/evilrat666/directx-d However they are marked as [discontinued] While I'm sure they will continue to work so wouldn't worry about using this I wonder if there are any other

Re: shared - i need it to be useful

2018-10-22 Thread John Colvin via Digitalmars-d
On Monday, 22 October 2018 at 00:22:19 UTC, Manu wrote: On Sun, Oct 21, 2018 at 2:35 PM Walter Bright via Digitalmars-d wrote: On 10/21/2018 2:08 PM, Walter Bright wrote: > On 10/21/2018 12:20 PM, Nicholas Wilson wrote: >> Yes, but the problem you describe is arises from implicit >>

When does GC run?

2018-10-16 Thread John Burton via Digitalmars-d-learn
Is there any documentation or information about the specifics of the garbage collector? The information I have found indicates that it runs to free memory when the system runs out of memory to allocate. But will this try to use all the system memory or some other amount before trying to

Re: Is there an efficient byte buffer queue?

2018-10-16 Thread John Burton via Digitalmars-d-learn
On Sunday, 14 October 2018 at 13:07:30 UTC, Heromyth wrote: On Monday, 8 October 2018 at 09:39:55 UTC, John Burton wrote: My use case is sending data to a socket. We have ported some containers from JAVA. ByteBuffer is a basic container interface and widely used in JAVA. See also: https

Is there an efficient byte buffer queue?

2018-10-08 Thread John Burton via Digitalmars-d-learn
My use case is sending data to a socket. One part of my program generates blocks of bytes, and the socket part tries to send them to the socket and then removes from the queue the number that got sent. I am currently using a byte[] and using concatenation and slicing to maintain the queue

Re: Private struct constructor

2018-10-04 Thread John Chapman via Digitalmars-d-learn
On Thursday, 4 October 2018 at 07:31:21 UTC, Ritchie wrote: Any reason why this works? https://run.dlang.io/is/TALlyw "private" applies to the module, not the type. https://dlang.org/spec/attribute.html#visibility_attributes

Re: Use nested functions as callbacks with Windows API functions?

2018-10-02 Thread John Chapman via Digitalmars-d-learn
On Monday, 1 October 2018 at 20:27:43 UTC, spikespaz wrote: Of course there is nothing wrong with defining each callback as a separate function, but then comes the issue of naming them. I also don't like the way it makes my code look. I think the best you can do is something like this: ---

Re: concurrency call to arms

2018-09-26 Thread John Belmonte via Digitalmars-d
On Thursday, 16 August 2018 at 20:30:26 UTC, John Belmonte wrote: These are novel control structures for managing concurrency. Combining this with cooperative multitasking and explicit, plainly-visible context switching (i.e. async/await-- sorry Olshansky) yields something truly

Re: Can I create static c callable library?

2018-09-26 Thread John Burton via Digitalmars-d-learn
On Tuesday, 25 September 2018 at 12:05:21 UTC, Jonathan M Davis wrote: [...] Thanks everyone. Is there any documentation anywhere that deals with calling D from C? I could find plenty the other way round. I think I'll give up on the idea though, and rewrite the whole thing in D :)

Can I create static c callable library?

2018-09-25 Thread John Burton via Digitalmars-d-learn
I need to write a library to statically link into a c program. Can I write this library in D? Will I be able to use proper D abilities like gc? Obviously the public interface will need to be basic c callable functions... I 'main' is a c program will this work?

Re: concurrency call to arms

2018-09-14 Thread John Belmonte via Digitalmars-d
On Tuesday, 28 August 2018 at 20:05:32 UTC, Russel Winder wrote: But that is the point, this is Python specific, and yet the motivating example is a misunderstanding of how Go is used. This inconsistency seriously undermines the general argument. I don't believe I misunderstand how Go is

Re: John Regehr on "Use of Assertions"

2018-09-09 Thread John Carter via Digitalmars-d
On Sunday, 9 September 2018 at 09:01:28 UTC, Ola Fosheim Grøstad wrote: Let's face it, the term "assert" has been poisoned by decades of ambiguity. There is really no ambiguity... The terminology is widespread and well understood across the field I think. Ahh, I so, so wish what you said

Re: John Regehr on "Use of Assertions"

2018-09-09 Thread John Carter via Digitalmars-d
On Sunday, 2 September 2018 at 01:55:53 UTC, Walter Bright wrote: On 9/1/2018 5:47 PM, Nick Sabalausky (Abscissa) wrote: All in all, John is very non-committal about the whole thing. He probably got tired of arguing about it :-) Let's face it, the term "assert" has been poisoned

Re: John Regehr on "Use of Assertions"

2018-09-03 Thread John Colvin via Digitalmars-d
On Monday, 3 September 2018 at 06:26:59 UTC, Jonathan M Davis wrote: Well, if that were the intention, then -release could not remove assertions from @safe code. -release does not remove bounds checking from @safe code. You have to use -boundscheck=off to disable assertions in @safe code

Re: John Regehr on "Use of Assertions"

2018-09-02 Thread John Colvin via Digitalmars-d
On Sunday, 2 September 2018 at 02:32:31 UTC, Jonathan M Davis wrote: On Saturday, September 1, 2018 2:15:15 PM MDT Walter Bright via Digitalmars- d wrote: https://blog.regehr.org/archives/1091 As usual, John nails it in a particularly well-written essay. "ASSERT(expr) As

Re: C++ Expected converted to idiomatic D

2018-08-28 Thread John Colvin via Digitalmars-d
On Thursday, 16 August 2018 at 20:37:33 UTC, Per Nordlöw wrote: In https://www.youtube.com/watch?v=nVzgkepAg5Y Andrei describes his proposal for STL `Expected` planned to be included in C++20. Have anybody converted the C++ proposal to idiomatic D, yet? Hopefully without the pointer-legacy

Re: concurrency call to arms

2018-08-27 Thread John Belmonte via Digitalmars-d
On Wednesday, 22 August 2018 at 16:49:01 UTC, Russel Winder wrote: Have you tried asyncio in the Python standard library? Is Trio better? The library that Guido admits is a disaster? https://twitter.com/gvanrossum/status/938445451908472832 Trio and libraries like it have evolved out of

Re: Go ahead and break code, but give us the tools to fix it. (Was Re: Dicebot on leaving D: It is anarchy driven development in all its glory.)

2018-08-26 Thread John Carter via Digitalmars-d
On Monday, 27 August 2018 at 04:00:18 UTC, John Carter wrote: Rather the assumption must be, a language processor eats source, it can (re)write source as well. And before any one mentions halting problems and the impossibility of a compiler understanding whether a refactoring is behaviour

Go ahead and break code, but give us the tools to fix it. (Was Re: Dicebot on leaving D: It is anarchy driven development in all its glory.)

2018-08-26 Thread John Carter via Digitalmars-d
On Saturday, 25 August 2018 at 20:52:06 UTC, Walter Bright wrote: If I fix the bug, I break existing code, and apparently a substantial amount of existing code. What's your advice on how to proceed with this? https://forum.dlang.org/post/ioiglnwckjsdrukpx...@forum.dlang.org I've been

Re: "Constructor" was a Very Bad name choice we have never recovered from (Was Re: D is dead)

2018-08-26 Thread John Carter via Digitalmars-d
Or to put it another way RAII should be "Taking Ownership of a Resource is Initialization, and relinquishing ownership is automatic at the object life time end, but Failure to Acquire a Resource Is Not An Exceptional Circumstance" Not as catchy, but far less problematic.

"Constructor" was a Very Bad name choice we have never recovered from (Was Re: D is dead)

2018-08-26 Thread John Carter via Digitalmars-d
On Friday, 24 August 2018 at 02:33:31 UTC, Jonathan M Davis wrote: Walter Bright wrote: My personal opinion is that constructors that throw are an execrable programming practice, and I've wanted to ban them. (Andrei, while sympathetic to the idea, felt that too many people relied on it.) I

Re: Cross compile windows programs on linux

2018-08-24 Thread John Burton via Digitalmars-d-learn
On Friday, 24 August 2018 at 15:26:30 UTC, kinke wrote: On Friday, 24 August 2018 at 13:10:40 UTC, John Burton wrote: Is in the subject. Are there any cross compilers that will run on a linux system but compile D code using Win32 into a windows .exe file, preferably 64 bit? I can find hints

Cross compile windows programs on linux

2018-08-24 Thread John Burton via Digitalmars-d-learn
Is in the subject. Are there any cross compilers that will run on a linux system but compile D code using Win32 into a windows .exe file, preferably 64 bit? I can find hints of cross compilers but not really seen anything packaged up?

Re: [OT] Leverage Points

2018-08-22 Thread John Carter via Digitalmars-d
On Wednesday, 22 August 2018 at 13:17:00 UTC, Kagamin wrote: On Monday, 20 August 2018 at 03:57:10 UTC, John Carter wrote: * Choice. ie. Programmers _want_ to use it, not are constrained to use it. * For programming activity, not new projects. ie. The era of vast tracts of green field

Re: [OT] Leverage Points

2018-08-19 Thread John Carter via Digitalmars-d
On Saturday, 18 August 2018 at 22:20:57 UTC, Walter Bright wrote: On 8/18/2018 9:59 AM, Jonathan Marler wrote: In your mind, what defines the D language's level of success? It no longer needs me or Andrei. I think that is a pretty weak measure. Stroustrup and Matsumoto are still actively

Re: concurrency call to arms

2018-08-18 Thread John Belmonte via Digitalmars-d
golang.org/doc/go1.2#preemption). Regards, --John

Re: concurrency call to arms

2018-08-16 Thread John Belmonte via Digitalmars-d
On Thursday, 16 August 2018 at 23:33:04 UTC, H. S. Teoh wrote: However, it would seem to require language support, no? It's going to be a tough sell to Walter & Andrei if it requires language support. (Though IMO it's worth it.) To implement scoped nursery and cancellation? I hope it could

concurrency call to arms

2018-08-16 Thread John Belmonte via Digitalmars-d
libraries to unify around this. I'll go out on a limb and say if this could happen in addition to D addressing its GC dirty laundry, the language would actually be an unstoppable force. Regards, --John

Re: Dpp on run.dlang.io

2018-08-04 Thread John Colvin via Digitalmars-d-announce
On Saturday, 4 August 2018 at 01:27:49 UTC, Laeeth Isharc wrote: Thanks to Seb and Atila it is now very easy to show a D program just #includeing C headers. If just works. Modulo bugs. In time I am hopeful Atila will start to have more of C++ headers working too.

Re: Bolts 0.4 meta programming library

2018-08-02 Thread John Colvin via Digitalmars-d-announce
On Thursday, 2 August 2018 at 08:40:55 UTC, John Colvin wrote: On Thursday, 2 August 2018 at 07:47:19 UTC, aliak wrote: Hi, just a release of a meta programming library (https://bolts.dub.pm) that has utilities that I use in personal projects, and that I find in phobos, and or in the forums

Re: Bolts 0.4 meta programming library

2018-08-02 Thread John Colvin via Digitalmars-d-announce
On Thursday, 2 August 2018 at 07:47:19 UTC, aliak wrote: Hi, just a release of a meta programming library (https://bolts.dub.pm) that has utilities that I use in personal projects, and that I find in phobos, and or in the forums. A notable difference is that functions here try to operate on

Re: Declaring a pointer to a function returning a ref

2018-07-31 Thread John Colvin via Digitalmars-d
On Tuesday, 31 July 2018 at 21:29:26 UTC, Jean-Louis Leroy wrote: How do I declare a variable that contains a pointer to a function returning a reference? import std.stdio; int foo(return ref int a) { a = 42; return a; } ref int bar(return ref int a) { a = 42;

Re: Moving druntime into the DMD repository

2018-07-27 Thread John Colvin via Digitalmars-d
On Friday, 27 July 2018 at 12:04:18 UTC, Jonathan M Davis wrote: On Friday, July 27, 2018 5:03:50 AM MDT Seb via Digitalmars-d wrote: What do you think? -- - Has the dmd/druntime split being annoying you too? - Do you have a better suggestion? - Would this break your workflow

Re: Struct Initialization syntax

2018-07-23 Thread John Colvin via Digitalmars-d
On Monday, 23 July 2018 at 16:57:20 UTC, H. S. Teoh wrote: On Mon, Jul 23, 2018 at 04:26:42PM +, Seb via Digitalmars-d wrote: tl;dr: the currently proposed syntax options are: --- struct S { int a = 2, b = 4, c = 6; } void foo() { bar(S({c: 10})); // Option 1 bar(S(c: 10)); //

throwing lots of resources at a GC

2018-07-19 Thread John Belmonte via Digitalmars-d
Interesting (and way too detailed for me) tale of GC adventures in golang: https://blog.golang.org/ismmkeynote

Re: Sutter's ISO C++ Trip Report - The best compliment is when someone else steals your ideas....

2018-07-18 Thread John Carter via Digitalmars-d
On Friday, 13 July 2018 at 13:15:39 UTC, Steven Schveighoffer wrote: But it doesn't scale if you use OS processes, it's too heavyweight. Of course, it depends on the application. If you only need 100 concurrent connections, processes might be OK. I think you may have fallen for Microsoft

Re: opCmp / opEquals do not actually support partial orders

2018-07-17 Thread John Colvin via Digitalmars-d
On Tuesday, 17 July 2018 at 18:21:26 UTC, H. S. Teoh wrote: As we know, when opCmp is defined for a user type, then opEquals must also be defined in order for == to work, even though in theory the compiler could translate x==y into x.opCmp(y)==0. In the past, it was argued that this was so

std.experimental.allocator and const etc.

2018-07-15 Thread John Colvin via Digitalmars-d
Currently the API's don't support const(void)[], e.g. import std.experimental.allocator : makeArray, theAllocator, dispose; import std.experimental.allocator.mallocator : Mallocator; void main() { const a = theAllocator.makeArray!ubyte(100); theAllocator.dispose(a); // can't call

Re: Sutter's ISO C++ Trip Report - The best compliment is when someone else steals your ideas....

2018-07-11 Thread John Carter via Digitalmars-d
On Wednesday, 11 July 2018 at 12:45:40 UTC, crimaniak wrote: The error should be maximally localized, and the programmer should be able to respond to any type of errors. The very nature of the work of WEB applications contributes to this. As a rule, queries are handled by short-lived tasks

Re: Multiple functions, same signature

2018-07-11 Thread John Colvin via Digitalmars-d
On Wednesday, 11 July 2018 at 15:58:05 UTC, Luís Marques wrote: I was surprised to find out today that this compiles: void foo() {} void foo() {} void main() {} Is it a bug, or just a weird design decision? "alphaglosined" on IRC seemed to think it was a regression. Please confirm, so that I

Re: Sutter's ISO C++ Trip Report - The best compliment is when someone else steals your ideas....

2018-07-09 Thread John Carter via Digitalmars-d
On Monday, 9 July 2018 at 22:50:07 UTC, Mr.Bingo wrote: On Tuesday, 3 July 2018 at 04:54:46 UTC, Walter Bright wrote: On 7/2/2018 7:53 PM, John Carter wrote: Step 2 is to (gradually) migrate std:: standard library precondition violations in particular from exceptions (or error codes

Re: Sutter's ISO C++ Trip Report - The best compliment is when someone else steals your ideas....

2018-07-08 Thread John Carter via Digitalmars-d
On Saturday, 7 July 2018 at 01:18:21 UTC, wjoe wrote: But that's not how D works. It throws an Error which can be caught. If people are allowed to do something they assume it's legitimate. It should be a compile time error to catch an Error, but it doesn't even emit a warning and it seems

Re: Sutter's ISO C++ Trip Report - The best compliment is when someone else steals your ideas....

2018-07-05 Thread John Carter via Digitalmars-d
On Tuesday, 3 July 2018 at 04:54:46 UTC, Walter Bright wrote: On 7/2/2018 7:53 PM, John Carter wrote: In general all pre/post/assert-condition violations) cause a corrupted state that cannot be recovered from programmatically, and so they should never be reported to the calling code

Re: Sutter's ISO C++ Trip Report - The best compliment is when someone else steals your ideas....

2018-07-02 Thread John Carter via Digitalmars-d
On Tuesday, 3 July 2018 at 03:27:06 UTC, Ali wrote: we have to thank Bertrand Meyer and his language Eiffel, for that True. I was referring to the ideas in Walter's proposal https://forum.dlang.org/thread/lrbpvj$mih$1...@digitalmars.com

Sutter's ISO C++ Trip Report - The best compliment is when someone else steals your ideas....

2018-07-02 Thread John Carter via Digitalmars-d
https://herbsutter.com/2018/07/02/trip-report-summer-iso-c-standards-meeting-rapperswil/ This looks to me like a huge step forward for C++ * You get to install your own violation handler and ship a release build with the option of turning on enforcement at run time. * You get to express

Re: D community's view on syntactic sugar

2018-06-30 Thread John Belmonte via Digitalmars-d
On Saturday, 16 June 2018 at 08:39:07 UTC, Dmitry Olshansky wrote: On Friday, 15 June 2018 at 23:04:40 UTC, Sjoerd Nijboer wrote: T* he `async` & `await` keyword from C# make proactor pattern async code extremely easy to reason about. God please no. Look at Go’s popularity because of dead

Re: D vs C++11

2018-06-28 Thread John parker via Digitalmars-d
On Friday, 2 November 2012 at 20:12:05 UTC, so wrote: On Friday, 2 November 2012 at 18:34:13 UTC, Jacob Carlborg wrote: I would absolutely say that the gap is getting thinner. I would mostly say that with C++11 C++ has finally started to catch up with D and the rest of the world. Serious?

<    1   2   3   4   5   6   7   8   9   10   >