Re: From the D Blog: Crafting Self-Evident Code in D

2023-10-26 Thread John Colvin via Digitalmars-d-announce
On Monday, 2 October 2023 at 17:28:19 UTC, Mike Parker wrote: It's been a long, long while since I published anything on the blog. I do intend to get pick it up again down the road, but Walter recently surprised me with plans of his own. He's taken the topic of his DConf '23 talk and derived a

Re: mutable pointers as associative array keys

2023-04-11 Thread John Colvin via Digitalmars-d-learn
On Monday, 10 April 2023 at 20:31:43 UTC, Steven Schveighoffer wrote: On 4/10/23 4:25 PM, Steven Schveighoffer wrote: It's also completely useless. Having const keys does nothing to guarantee unchanging keys. Another half-assed attempt to be encode correct semantics but fails completely in its

mutable pointers as associative array keys

2023-04-10 Thread John Colvin via Digitalmars-d-learn
It seems that it isn't possible, am I missing something? alias Q = int[int*]; pragma(msg, Q); // int[const(int)*] Also, is this documented somewhere?

Re: text based file formats

2022-12-21 Thread John Colvin via Digitalmars-d-announce
On Wednesday, 21 December 2022 at 04:19:46 UTC, 9il wrote: On Tuesday, 20 December 2022 at 19:46:36 UTC, John Colvin wrote: On Tuesday, 20 December 2022 at 00:40:07 UTC, H. S. Teoh wrote: [...] We use this at work with some light tweaks, it’s done a lot work  It has already been replaced

Re: text based file formats

2022-12-20 Thread John Colvin via Digitalmars-d-announce
On Tuesday, 20 December 2022 at 00:40:07 UTC, H. S. Teoh wrote: On Mon, Dec 19, 2022 at 04:16:57PM -0800, Walter Bright via Digitalmars-d-announce wrote: On 12/19/2022 4:35 AM, Adam D Ruppe wrote: > On Monday, 19 December 2022 at 09:55:47 UTC, Walter Bright > wrote: > > Curious why CSV isn't

Re: Beerconf October 2022

2022-10-30 Thread John Colvin via Digitalmars-d-announce
On Sunday, 30 October 2022 at 01:50:33 UTC, Steven Schveighoffer wrote: On 10/29/22 2:00 PM, FeepingCreature wrote: On Saturday, 29 October 2022 at 10:14:31 UTC, rikki cattermole wrote: And now for some good news! Its almost Halloween, so grab your candy and any spooky brews you may have,

Re: Symmetry looking for D programmers in Singapore/Hong Kong/Australia/New Zealand

2021-06-17 Thread John Colvin via Digitalmars-d-announce
On Wednesday, 16 June 2021 at 17:13:35 UTC, russhy wrote: For what kind of project? need more info It might help to look at https://jobs.symmetryinvestments.dev/ and https://github.com/symmetryinvestments/

Re: From the D Blog -- Interfacing D with C: Strings Part One

2021-05-24 Thread John Colvin via Digitalmars-d-announce
On Monday, 24 May 2021 at 16:16:53 UTC, Steven Schveighoffer wrote: On 5/24/21 10:02 AM, Mike Parker wrote: The latest post in the D and C series dives into the weeds of D and C strings: how they're implemented, when you need to NUL-terminate your D strings and when you don't, and how the

Re: Printing shortest decimal form of floating point number with Mir

2021-01-04 Thread John Colvin via Digitalmars-d-announce
On Monday, 4 January 2021 at 17:22:55 UTC, John Colvin wrote: On Monday, 4 January 2021 at 13:47:17 UTC, Ola Fosheim Grøstad wrote: [...] I have a longer reply I'm trying to write, but just to make sure I'm on the right track: template Foo(T) { alias Foo = T; }

Re: Printing shortest decimal form of floating point number with Mir

2021-01-04 Thread John Colvin via Digitalmars-d-announce
On Monday, 4 January 2021 at 13:47:17 UTC, Ola Fosheim Grøstad wrote: On Monday, 4 January 2021 at 12:35:12 UTC, John Colvin wrote: What's the simplest example that doesn't work and is that simple example just indirection through an alias or is it actually indirection through a template that

Re: Printing shortest decimal form of floating point number with Mir

2021-01-04 Thread John Colvin via Digitalmars-d-announce
On Monday, 4 January 2021 at 09:21:02 UTC, Ola Fosheim Grøstad wrote: On Monday, 4 January 2021 at 09:18:50 UTC, Ola Fosheim Grøstad wrote: On Monday, 4 January 2021 at 05:55:37 UTC, Ola Fosheim Grostad wrote: On Monday, 4 January 2021 at 04:37:22 UTC, 9il wrote: I suppose the answer would be

Re: Printing shortest decimal form of floating point number with Mir

2020-12-24 Thread John Colvin via Digitalmars-d-announce
On Thursday, 24 December 2020 at 14:14:33 UTC, 9il wrote: On Thursday, 24 December 2020 at 14:08:32 UTC, welkam wrote: On Wednesday, 23 December 2020 at 18:05:40 UTC, 9il wrote: It was a mockery executed by Atila Read the all comments and didnt saw any mockery Yes, it wasn't explicit. He

Re: MIR vs. Numpy

2020-11-18 Thread John Colvin via Digitalmars-d-announce
On Wednesday, 18 November 2020 at 13:01:42 UTC, Bastiaan Veelo wrote: On Wednesday, 18 November 2020 at 10:05:06 UTC, Tobias Schmidt wrote: Dear all, to compare MIR and Numpy in the HPC context, we implemented a multigrid solver in Python using Numpy and in D using Mir and perforemd some

Highlight general point about software dev and design in general.

2020-10-22 Thread John Colvin via Digitalmars-d-announce
On Tuesday, 20 October 2020 at 21:58:16 UTC, Johan Engelen wrote: On Tuesday, 20 October 2020 at 20:21:56 UTC, aberba wrote: On Tuesday, 20 October 2020 at 17:36:11 UTC, kinke wrote: On Tuesday, 20 October 2020 at 16:08:47 UTC, aberba wrote: It's an option but doesn't fill the need for an

Re: Beta 2.094.0

2020-09-18 Thread John Colvin via Digitalmars-d-announce
On Friday, 18 September 2020 at 13:35:34 UTC, Jacob Carlborg wrote: On 2020-09-17 12:10, John Colvin wrote: I personally think it's not so bad as long as the commit gets written to the dub.selections.json It doesn't. I know. But it should be. But then again a lot of things “should be”

Re: Beta 2.094.0

2020-09-17 Thread John Colvin via Digitalmars-d-announce
On Wednesday, 16 September 2020 at 18:52:23 UTC, Jacob Carlborg wrote: On 2020-09-16 19:20, mw wrote: Why it's deprecated? can we revive it? It was deprecated because it's a bad idea to not lock versions. Using `~master` would fetch the latest code from the "master" branch when compiling.

Re: Decimal string to floating point conversion with correct half-to-even rounding

2020-07-07 Thread John Colvin via Digitalmars-d-announce
On Tuesday, 7 July 2020 at 15:08:33 UTC, Adam D. Ruppe wrote: On Tuesday, 7 July 2020 at 13:00:04 UTC, Steven Schveighoffer wrote: Doing that these days would be silly. You can depend on a specific version of a repository without problems. I always have problems when trying to do that. git

Re: Rationale for accepting DIP 1028 as is

2020-05-27 Thread John Colvin via Digitalmars-d-announce
On Wednesday, 27 May 2020 at 05:49:49 UTC, Walter Bright wrote: On 5/26/2020 9:31 AM, Bruce Carneal wrote: Currently a machine checked @safe function calling an unannotated extern C routine will error out during compilation. This is great as the C routine was not machine checked, and

Re: Objective C protocols

2020-05-17 Thread John Colvin via Digitalmars-d-learn
On Saturday, 16 May 2020 at 19:14:51 UTC, John Colvin wrote: What's the best way to implement an Objective C protocol in D? I see mention here https://dlang.org/changelog/2.085.0.html#4_deprecated_objc_interfaces but it's not clear where things are these days. Based on some experimentation,

Objective C protocols

2020-05-16 Thread John Colvin via Digitalmars-d-learn
What's the best way to implement an Objective C protocol in D? I see mention here https://dlang.org/changelog/2.085.0.html#4_deprecated_objc_interfaces but it's not clear where things are these days.

Re: Luneta: terminal fuzzy finder

2020-05-05 Thread John Colvin via Digitalmars-d-announce
On Tuesday, 5 May 2020 at 07:31:18 UTC, Panke wrote: On Monday, 4 May 2020 at 22:49:49 UTC, Felipe wrote: Hi, I develop an interactive terminal fuzzy finder in D with ncurses. Feel free to check it out and contribute. Any feedback is welcome. Thanks, Felipe [1]

Re: dmdcache

2020-04-25 Thread John Colvin via Digitalmars-d-announce
On Saturday, 25 April 2020 at 10:17:50 UTC, Ali Çehreli wrote: A colleague of mine has written dmdcache which may be very useful for some projects: https://github.com/seeraven/dmdcache It drops our build time from 8 minutes to 45 seconds on a particular build environment for about

Re: DConf 2019 Pictures

2020-01-07 Thread John Colvin via Digitalmars-d-announce
On Tuesday, 7 January 2020 at 13:37:24 UTC, Ethan wrote: On Tuesday, 7 January 2020 at 09:04:04 UTC, Ali Çehreli wrote: This one is Laeeth introducing Andrei at Symmetry Investments: http://acehreli.org/photo/dconf_2019/DSC04839.html Ali And if you start here you get to the important

Re: code.dlang.org downtime

2019-12-18 Thread John Colvin via Digitalmars-d-announce
On Wednesday, 18 December 2019 at 10:18:03 UTC, Sebastiaan Koppe wrote: On Wednesday, 18 December 2019 at 09:29:50 UTC, John Colvin wrote: This is still down for me, regardless of using the IP or address. I don't think it's just me either: https://stats.uptimerobot.com/6mQX4Crw2L/783838659

Re: code.dlang.org downtime

2019-12-18 Thread John Colvin via Digitalmars-d-announce
On Monday, 16 December 2019 at 11:04:38 UTC, Sönke Ludwig wrote: As you may have already noticed, the main registry server, code.dlang.org got unreachable yesterday. This was caused by an old VPS of mine getting terminated. The registry had already moved to a different server years ago, but,

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 an

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 on a

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 interface, in

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: 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: 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: 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 >>

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) Asserts that an

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: 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)); //

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: 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: string file = __FILE__ considered harmful (and solution)

2018-05-30 Thread John Colvin via Digitalmars-d
On Wednesday, 30 May 2018 at 14:40:50 UTC, Steven Schveighoffer wrote: On 5/30/18 4:27 AM, FeepingCreature wrote: There's a very common idiom where in order to report line numbers of an error or a log line at the callsite of a function, you pass __FILE__ and __LINE__ as default parameters:

Re: T opImplCast(T)() so we can add @disable to it?

2018-05-24 Thread John Colvin via Digitalmars-d
On Thursday, 24 May 2018 at 07:37:40 UTC, Sjoerd Nijboer wrote: On Thursday, 24 May 2018 at 07:06:03 UTC, Bastiaan Veelo wrote: On Thursday, 24 May 2018 at 06:42:51 UTC, Sjoerd Nijboer wrote: On Thursday, 24 May 2018 at 01:39:56 UTC, Jonathan M Davis wrote: If you don't want an implict cast,

Re: Online impersonation

2018-05-24 Thread John Colvin via Digitalmars-d
On Thursday, 24 May 2018 at 06:32:23 UTC, Dukc wrote: On Wednesday, 23 May 2018 at 17:31:40 UTC, Steven Schveighoffer wrote: The IP address is included in the headers of the newsgroup. All of them came from the same IP. I have a filter on my thunderbird client to flag certain IPs, and his was

Re: #include C headers in D code

2018-04-12 Thread John Colvin via Digitalmars-d-announce
On Wednesday, 11 April 2018 at 18:36:56 UTC, Walter Bright wrote: On 4/11/2018 3:25 AM, Atila Neves wrote: I did the best I could having seen some macros. It's likely there are cases I've missed, or that maybe the translation in the link above doesn't work even for what it's supposed to be

Re: I used to be able to use a bffer for toUTF operation, what happened ?

2018-04-11 Thread John Colvin via Digitalmars-d
On Wednesday, 11 April 2018 at 12:04:24 UTC, deadalnix wrote: This used to be an option: dchar val = ...; char[4] buf; toUTF8(buf, val); Now I'm getting an error. Looking at the doc, it seems that there are only option returning a string, which I assume is allocated on the GC. Has the

Re: DUB: Only fetch and cache packages in dub.json without running build

2018-04-10 Thread John Colvin via Digitalmars-d
On Tuesday, 10 April 2018 at 13:50:38 UTC, Clinton wrote: Hi all, I'm setting up a CircleCI config for my project. Right now I'm trying to cache dependencies before running builds. This way I can run "dub build --nodeps" immediately after the packages are cached to avoid extra network calls

Re: DUB: Only fetch and cache packages in dub.json without running build

2018-04-10 Thread John Colvin via Digitalmars-d
On Tuesday, 10 April 2018 at 15:31:41 UTC, John Colvin wrote: On Tuesday, 10 April 2018 at 13:50:38 UTC, Clinton wrote: Hi all, I'm setting up a CircleCI config for my project. Right now I'm trying to cache dependencies before running builds. This way I can run "dub build --nodeps"

Re: rvalues -> ref (yup... again!)

2018-03-26 Thread John Colvin via Digitalmars-d
On Monday, 26 March 2018 at 14:40:03 UTC, Atila Neves wrote: On Friday, 23 March 2018 at 22:01:44 UTC, Manu wrote: Forked from the x^^y thread... There are too many replies on this thread, addressing all the comments would take forever and pollute the thread itself. So forgive me if I say

Re: rvalues -> ref (yup... again!)

2018-03-24 Thread John Colvin via Digitalmars-d
On Saturday, 24 March 2018 at 17:30:35 UTC, Manu wrote: On 24 March 2018 at 04:57, John Colvin via Digitalmars-d <digitalmars-d@puremagic.com> wrote: On Friday, 23 March 2018 at 22:01:44 UTC, Manu wrote: Forked from the x^^y thread... On 23 March 2018 at 12:16, Walter Bright via Digit

Re: rvalues -> ref (yup... again!)

2018-03-24 Thread John Colvin via Digitalmars-d
On Friday, 23 March 2018 at 22:01:44 UTC, Manu wrote: Forked from the x^^y thread... On 23 March 2018 at 12:16, Walter Bright via Digitalmars-d wrote: On 3/23/2018 11:09 AM, Manu wrote: [...] Rvalue references are not trivial and can have major unintended

Re: help cast

2018-03-19 Thread John Colvin via Digitalmars-d
On Monday, 19 March 2018 at 11:20:05 UTC, Steven Schveighoffer wrote: Let me adjust your example a bit, and see if you still agree: auto bytes = cast(ubyte[])[55_444, 289, 1_000_000, 846, 123_456_789]; writeln(bytes); // [148, 33, 64, 78, 21] I have used cast(ubyte[]) to get ubytes as well,

Re: DIP 1006 - Preliminary Review Round 1

2018-03-06 Thread John Colvin via Digitalmars-d
On Tuesday, 6 March 2018 at 02:05:58 UTC, Walter Bright wrote: On 3/5/2018 2:30 PM, John Colvin wrote: This just feels bad. Adding extra failsafes for my debug program shouldn't make my release program less safe. Then use `enforce()`. So, to clarify, adding asserts to my code makes my

Re: DIP 1006 - Preliminary Review Round 1

2018-03-05 Thread John Colvin via Digitalmars-d
On Monday, 5 March 2018 at 10:30:12 UTC, Walter Bright wrote: The idea behind removal of the runtime checks is as a performance optimization done on a debugged program. It's like turning on or off array bounds checking. Many leave asserts and array bounds checking on even in released code to

Re: PackedAliasSeq?

2018-02-24 Thread John Colvin via Digitalmars-d
On Thursday, 22 February 2018 at 19:26:54 UTC, Andrei Alexandrescu wrote: After coding https://github.com/dlang/phobos/pull/6192 with AliasSeq, the experience has been quite pleasurable. However, in places the AliasSeq tends to expand too eagerly, leading to a need to "keep it together" e.g.

Re: Workaround for https://issues.dlang.org/show_bug.cgi?id=18422?

2018-02-11 Thread John Colvin via Digitalmars-d
On Sunday, 11 February 2018 at 15:34:07 UTC, Andrei Alexandrescu wrote: I'm trying to sketch a simple compile-time reflection system, and https://issues.dlang.org/show_bug.cgi?id=18422 is a blocker of the entire approach. My intent is to have a struct Module, which can be initialized with a

Re: Channeling memory model experts...

2018-01-24 Thread John Colvin via Digitalmars-d
On Wednesday, 24 January 2018 at 18:37:54 UTC, Andrei Alexandrescu wrote: ... to review https://github.com/dlang/druntime/pull/2057/. Thanks! -- Andrei Which memory model would that be? D's?

Re: LDC 1.7.0

2018-01-07 Thread John Colvin via Digitalmars-d-announce
On Saturday, 6 January 2018 at 16:25:46 UTC, German Diago wrote: - want no gc? Ok, at least there is BetterC, so if I invest myself quite a bit on D (I am the kind of programmer that likes to squeeze power out of machines, so this always means that I will not consider VM languages), I will

Re: Some Observations on the D Development Process

2018-01-05 Thread John Colvin via Digitalmars-d
On Friday, 5 January 2018 at 04:26:25 UTC, Walter Bright wrote: I can't agree with the "just close older bugs and PRs." There's good stuff in them. Even if the PR is no good, it provides insight to someone working on a better fix. Closing it means nobody will ever be aware of it or look at it

Re: toChars Bug?

2017-12-12 Thread John Colvin via Digitalmars-d
On Tuesday, 12 December 2017 at 15:19:48 UTC, ketmar wrote: p.s.: but no, i am wrong. foo(-42); this is perfectly valid for `foo (uint n)`, as D converts negative ints to uints without any warnings. so no, overloads won't fit. hmm yes, it seems it is not possible.

Re: toChars Bug?

2017-12-12 Thread John Colvin via Digitalmars-d
On Tuesday, 12 December 2017 at 12:49:32 UTC, ketmar wrote: see documentation: http://dpldocs.info/experimental-docs/std.conv.toChars.html "...Can be uint or ulong. If radix is 10, can also be int or long." 45 is int, not uint. so no radices except `10` will work. I think it would be

Re: @ctfeonly

2017-12-08 Thread John Colvin via Digitalmars-d
On Thursday, 7 December 2017 at 01:21:11 UTC, Nicholas Wilson wrote: I'd like to add an attribute to indicate that the annotated function is only available at compile time so that in cases where the operation is invalid at runtime (strings and concatenation on a GPU for instance) but the

Re: gdc is in

2017-10-07 Thread John Colvin via Digitalmars-d
On Saturday, 7 October 2017 at 16:46:44 UTC, Iain Buclaw wrote: On 7 October 2017 at 15:00, jmh530 via Digitalmars-d wrote: On Saturday, 7 October 2017 at 10:24:38 UTC, Joakim wrote: [...] Also, maybe it will be easier to get people to help him if they know

Re: gdc is in

2017-10-06 Thread John Colvin via Digitalmars-d
On Friday, 6 October 2017 at 17:04:39 UTC, Iain Buclaw wrote: On 6 October 2017 at 17:21, jmh530 via Digitalmars-d wrote: On Friday, 6 October 2017 at 15:04:25 UTC, Joakim wrote: I assume you mean ddmd and static foreach, the mailing list post linked from my

Re: Proposal: Object/?? Destruction

2017-10-04 Thread John Colvin via Digitalmars-d
On Wednesday, 4 October 2017 at 10:03:56 UTC, aberba wrote: Upon reading this, It triggered an idea. On Saturday, 30 September 2017 at 16:10:44 UTC, Jonathan Marler wrote: https://wiki.dlang.org/DIP88 I'd like to see DIP88 (Named Parameters) revived. Was this proposal rejected or is it

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

2017-09-27 Thread John Colvin via Digitalmars-d
On Friday, 22 September 2017 at 17:11:56 UTC, Ilya Yaroshenko wrote: Should we add `a * b` to ndslice for 1d vectors? Discussion at https://github.com/libmir/mir-algorithm/issues/91 Unless it's always just simple element-wise, make it a different type. N-dimensional rectangular data

Re: code.dlang.org is offline?

2017-09-22 Thread John Colvin via Digitalmars-d
On Friday, 22 September 2017 at 08:14:43 UTC, Szabo Bogdan wrote: Hi, Is there a reason why code.dlang.org is offline? Thanks, Bogdan Works for me

Re: Specifying @nogc on structs seems to have no effect

2017-09-19 Thread John Colvin via Digitalmars-d
On Tuesday, 19 September 2017 at 13:11:03 UTC, Craig Black wrote: I've recently tried coding in D again after some years. One of my earlier concerns was the ability to code without the GC, which seemed difficult to pull off. To be clear, I want my programs to be garbage collected, but I want

Re: D std.regex is so slow

2017-09-19 Thread John Colvin via Digitalmars-d
On Tuesday, 19 September 2017 at 10:14:05 UTC, Dmitry Olshansky wrote: On Tuesday, 19 September 2017 at 07:53:27 UTC, Daniel Kozak wrote: https://github.com/mariomka/regex-benchmark#performance Do you know why? Here is a code:

Re: Hong Kong dlang Meetup

2017-09-08 Thread John Colvin via Digitalmars-d-announce
On Monday, 4 September 2017 at 19:25:59 UTC, Jonathan M Davis wrote: Several of us from the D community will be in Hong Kong on a business trip next week (me, John Colvin, Atila Neves, and Ilya Yaroshenko), and our client, Symmetry Investments[1], has offered to sponsor a dlang meetup. We

Re: Hong Kong dlang Meetup

2017-09-06 Thread John Colvin via Digitalmars-d-announce
On Wednesday, 6 September 2017 at 00:48:07 UTC, Lionello Lunesu wrote: Let's occupy codeaholics: https://www.meetup.com/Codeaholics/events/242640432/ Good idea. I'll be there :)

Re: Templates, D way

2017-09-05 Thread John Colvin via Digitalmars-d
On Tuesday, 5 September 2017 at 12:41:45 UTC, Computermatronic wrote: On Tuesday, 5 September 2017 at 12:20:14 UTC, crimaniak wrote: [...] I find it very strange that this works, as a non-mixin template should not be able to capture the context of where it was instantiated. If you take the

Re: Templates, D way

2017-09-05 Thread John Colvin via Digitalmars-d
On Tuesday, 5 September 2017 at 11:08:57 UTC, Void-995 wrote: Hi, everyone. I'm pretty new to D and trying my first steps in it. Currently I'm trying to port some code from C/C++ with pretty weird data structures and don't like idea of making boilerplate functions for accessing sub-lists in

Re: D as a Better C

2017-08-23 Thread John Colvin via Digitalmars-d-announce
On Wednesday, 23 August 2017 at 13:12:04 UTC, Mike Parker wrote: To coincide with the improvements to -betterC in the upcoming DMD 2.076, Walter has published a new article on the D blog about what it is and why to use it. A fun read. And I'm personally happy to see the love this feature is

Re: threads, fibers and GPU kernels

2017-08-07 Thread John Colvin via Digitalmars-d
On Monday, 7 August 2017 at 08:57:35 UTC, Nicholas Wilson wrote: On Monday, 7 August 2017 at 07:38:34 UTC, Suliman wrote: Modern GPU have thousands of GPU kernels, it's far from CPU kernels, but it's interesting for me is there any chance that in future they be used in same maner as CPU

Re: Problem of undefined behaviour with overloaded methods and overloaded delegate's invokers

2017-08-01 Thread John Colvin via Digitalmars-d
On Tuesday, 1 August 2017 at 11:07:59 UTC, knex wrote: I came across a strange thing and I am not sure if this is a bug or just an undefined behaviour of a compiler. Here is some sample code to present the case: // alias BoolFirst = void delegate(bool b, string s); alias StringFirst = void

Re: why no statements inside mixin teplates?

2017-07-27 Thread John Colvin via Digitalmars-d
On Friday, 12 May 2017 at 00:20:13 UTC, سليمان السهمي (Soulaïman Sahmi) wrote: Is there a rational behind not allowing statements inside mixin templates? I know mixin does accept code containing statements, but using mixin is much uglier. so I was wondering. example use case:

Re: scope pointers in @safe code

2017-07-26 Thread John Colvin via Digitalmars-d
On Wednesday, 26 July 2017 at 08:20:42 UTC, Shachar Shemesh wrote: void fn(scope int* var) @safe { (*var)++; } void fn2() @safe { int a; fn(); } The above program does not compile: d.d(8): Error: cannot take address of local a in @safe function fn2 I propose that the scope

Re: Boston D Meetup: Strawman Structs

2017-07-25 Thread John Colvin via Digitalmars-d-announce
On Sunday, 2 July 2017 at 10:35:49 UTC, Steven Schveighoffer wrote: I'll have a short presentation on a weird trick I discovered while writing some MySQL serialization code. Hope you can attend! https://www.eventbrite.com/e/d-lang-presentation-strawman-structs-tickets-35120523431 -Steve Is

Re: proposed @noreturn attribute

2017-07-18 Thread John Colvin via Digitalmars-d
On Monday, 17 July 2017 at 23:01:40 UTC, Walter Bright wrote: On 7/16/2017 5:41 AM, Timon Gehr wrote: struct S{ T x; Bottom everything; } turns the entire struct into an empty type. It is therefore most natural to say that Bottom.sizeof == ∞. (It's the only choice for which S.sizeof

Re: DCompute: GPGPU with Native D for OpenCL and CUDA

2017-07-18 Thread John Colvin via Digitalmars-d-announce
On Tuesday, 18 July 2017 at 00:49:11 UTC, Nicholas Wilson wrote: On Monday, 17 July 2017 at 13:50:22 UTC, Mike Parker wrote: Nicholas Wilson has put together a blog post on his progress with DCompute, expanding on his DConf talk. I have to admit that this is one of the D projects I'm most

Re: static foreach is now in github master

2017-07-17 Thread John Colvin via Digitalmars-d-announce
On Monday, 17 July 2017 at 18:14:35 UTC, Andrei Alexandrescu wrote: For those who want to play with our new static foreach feature and are willing to take the steps to building their own dmd, the feature is now merged in master: https://github.com/dlang/dmd/pull/6760 Happy hacking! Andrei

Re: Idiomatic FFT(W) Wrapper

2017-07-13 Thread John Colvin via Digitalmars-d-learn
On Thursday, 13 July 2017 at 12:49:40 UTC, Per Nordlöw wrote: Have anybody constructed an idiomatic D wrapper for FFTW? No, sorry, although I have used the library quite a bit in D. http://www.fftw.org/fftw3_doc/Tutorial.html#Tutorial I'm specifically concerned about -

Re: DIP 1010--Static foreach--Formal Review

2017-07-12 Thread John Colvin via Digitalmars-d
On Tuesday, 11 July 2017 at 23:50:26 UTC, Steven Schveighoffer wrote: On 7/11/17 7:21 PM, H. S. Teoh via Digitalmars-d wrote: On Tue, Jul 11, 2017 at 07:18:51PM -0400, Steven Schveighoffer via Digitalmars-d wrote: [...] 3. The only controversial part I see is that `break` doesn't break from

Re: Why is phobos so wack?

2017-07-09 Thread John Colvin via Digitalmars-d
On Sunday, 9 July 2017 at 12:56:55 UTC, FoxyBrown wrote: import string. ... return str.join(" "); gives Error: template std.array.join cannot deduce function from argument types !()(string, string) Well there's your mistake? There is no function `join` that takes (string, string).

Re: proposed @noreturn attribute

2017-07-08 Thread John Colvin via Digitalmars-d
On Saturday, 8 July 2017 at 12:17:57 UTC, Andrei Alexandrescu wrote: On 7/8/17 6:15 AM, Walter Bright wrote: Has anyone a better idea? Does anyone want to write a DIP for this? An attribute is fine. A more PL-minded possibility is to return a specific type: struct None { @disable

Re: Compilation times and idiomatic D code

2017-07-06 Thread John Colvin via Digitalmars-d
On Wednesday, 5 July 2017 at 20:32:08 UTC, Stefan Koch wrote: On Wednesday, 5 July 2017 at 20:12:40 UTC, H. S. Teoh wrote: I vaguely remember there was talk about compressing symbols when they get too long... is there any hope of seeing this realized in the near future? Yes there is.

  1   2   3   4   5   6   7   8   9   10   >