Re: Interesting Observation from JAXLondon

2018-10-11 Thread Russel Winder via Digitalmars-d
This was supposed to come to this list not the learn list. On Thu, 2018-10-11 at 07:57 +0100, Russel Winder wrote: > It seems that in the modern world of Cloud and Kubernetes, and the charging > model of the Cloud vendors, that the startup times of JVMs is becoming a > financial problem. A number

Re: Passing $ as a function argument

2018-10-11 Thread Simen Kjærås via Digitalmars-d
On Wednesday, 10 October 2018 at 23:04:46 UTC, James Japherson wrote: The whole point is not to use $ as an identifier but to specify to the compiler of that it can rewrite it. I know. I'm pointing out that as syntactic sugar, it can't be passed as an int. You seem to think that what the co

Re: Passing $ as a function argument

2018-10-10 Thread crimaniak via Digitalmars-d
On Wednesday, 10 October 2018 at 23:04:46 UTC, James Japherson wrote: The whole point is not to use $ as an identifier but to specify to the compiler of that it can rewrite it. It's called 'alias'. // compile time int foo(alias index)(int[] a) { return a[index(a.length)]; } // run t

Re: Farewell (of sorts)

2018-10-10 Thread Ali Çehreli via Digitalmars-d
Good luck! On 10/04/2018 06:15 AM, Shachar Shemesh wrote: > D will no longer be my day job. After a one year distraction with Go, I'm back to C++ myself. I've just finished my first reading of Scott Meyers' "Effective Modern C++" Oh boy! :) I'm reminded one more time that C++ is very hard to

Re: A Friendly Challenge for D

2018-10-10 Thread Ali Çehreli via Digitalmars-d
On 10/10/2018 07:52 PM, Jabari Zakiyth wrote: > On Wednesday, 10 October 2018 at 22:25:17 UTC, Neia Neutuladh wrote: >> On 10/10/2018 03:05 PM, Jabari Zakiya wrote: >>> https://www.scribd.com/doc/228155369/The-Segmented-Sieve-of-Zakiya-SSoZ >> >> It would be great if you could provide a link to a

Re: A Friendly Challenge for D

2018-10-10 Thread Jabari Zakiyth via Digitalmars-d
On Thursday, 11 October 2018 at 00:22:10 UTC, tide wrote: On Wednesday, 10 October 2018 at 16:15:56 UTC, Jabari Zakiya wrote: I would like to include in my paper a good comparison of various implementations in different compiled languages (C/C++, D, Nim, etc) to show how it performs with each.

Re: A Friendly Challenge for D

2018-10-10 Thread Jabari Zakiyth via Digitalmars-d
On Wednesday, 10 October 2018 at 22:25:17 UTC, Neia Neutuladh wrote: On 10/10/2018 03:05 PM, Jabari Zakiya wrote: https://www.scribd.com/doc/228155369/The-Segmented-Sieve-of-Zakiya-SSoZ It would be great if you could provide a link to a freely downloadable version of this. You can download

Re: Farewell (of sorts)

2018-10-10 Thread Walter Bright via Digitalmars-d
On 10/4/2018 6:15 AM, Shachar Shemesh wrote: One of those things is this: October 14th will be my last day working for Weka.IO. My best wishes for your next adventure! -Walter

Re: Passing $ as a function argument

2018-10-10 Thread Neia Neutuladh via Digitalmars-d
On 10/10/2018 05:01 PM, James Japherson wrote: All I'm proposing is to to allow one to escape that syntax to function calls. foo(int index) {    return arr[index]; } and D can support foo($-1); which simply gets translated in to arr[arr.length - 1] I think you might have a misunderstandi

Re: Passing $ as a function argument

2018-10-10 Thread Vladimir Panteleev via Digitalmars-d
On Wednesday, 10 October 2018 at 08:46:42 UTC, James Japherson wrote: Would be nice to be able to pass $ as a function argument to be used in automatic path length traversing. You can already do this, by returning a custom type from opDollar: /// Define RealNumbers so that, given `RealNumbers

Re: A Friendly Challenge for D

2018-10-10 Thread tide via Digitalmars-d
On Wednesday, 10 October 2018 at 16:15:56 UTC, Jabari Zakiya wrote: I would like to include in my paper a good comparison of various implementations in different compiled languages (C/C++, D, Nim, etc) to show how it performs with each. If you want help with your paper, possibly some kind of d

Re: Passing $ as a function argument

2018-10-10 Thread James Japherson via Digitalmars-d
On Wednesday, 10 October 2018 at 23:26:38 UTC, Dennis wrote: Can you give a real-world, non-foo/bar example where you want to use it? I have trouble understanding what you want to accomplish. I don't understand why you need to be convinced that this is relevant. Do you not realize that th

Re: Passing $ as a function argument

2018-10-10 Thread Dennis via Digitalmars-d
Can you give a real-world, non-foo/bar example where you want to use it? I have trouble understanding what you want to accomplish. On Wednesday, 10 October 2018 at 23:04:46 UTC, James Japherson wrote: It also has no context in and of itself. The compiler knows what to do with it... The same ca

Re: Passing $ as a function argument

2018-10-10 Thread James Japherson via Digitalmars-d
On Wednesday, 10 October 2018 at 13:32:15 UTC, Simen Kjærås wrote: On Wednesday, 10 October 2018 at 08:46:42 UTC, James Japherson wrote: Would be nice to be able to pass $ as a function argument to be used in automatic path length traversing. void foo(int loc) { return bar[loc]; } then fo

Re: A Friendly Challenge for D

2018-10-10 Thread Neia Neutuladh via Digitalmars-d
On 10/10/2018 03:05 PM, Jabari Zakiya wrote: https://www.scribd.com/doc/228155369/The-Segmented-Sieve-of-Zakiya-SSoZ It would be great if you could provide a link to a freely downloadable version of this.

Re: A Friendly Challenge for D

2018-10-10 Thread Jabari Zakiya via Digitalmars-d
On Wednesday, 10 October 2018 at 20:43:01 UTC, Kagamin wrote: On Wednesday, 10 October 2018 at 16:15:56 UTC, Jabari Zakiya wrote: https://gist.github.com/jzakiya/6c7e1868bd749a6b1add62e3e3b2341e As i understand, main thread preallocates global memory and tracks it, and other threads don't tra

Re: A Friendly Challenge for D

2018-10-10 Thread Kagamin via Digitalmars-d
On Wednesday, 10 October 2018 at 16:15:56 UTC, Jabari Zakiya wrote: https://gist.github.com/jzakiya/6c7e1868bd749a6b1add62e3e3b2341e As i understand, main thread preallocates global memory and tracks it, and other threads don't track it?

Re: A Friendly Challenge for D

2018-10-10 Thread SrMordred via Digitalmars-d
On Wednesday, 10 October 2018 at 16:15:56 UTC, Jabari Zakiya wrote: [...] Looking forward to this :)

Re: Passing $ as a function argument

2018-10-10 Thread Neia Neutuladh via Digitalmars-d
On 10/10/2018 01:46 AM, James Japherson wrote: Would be nice to be able to pass $ as a function argument to be used in automatic path length traversing. $ only works in indexing operations because that's required to figure out what it refers to. However, you can mostly use it as a readonly va

A Friendly Challenge for D

2018-10-10 Thread Jabari Zakiya via Digitalmars-d
Hi. I hope this is the right place to request this, if not please tell me a better one. I had looked at D, and played with it some circa 2010~2012, but time and life took my priorities away. But I'm still interested in learning different languages, but there are so many more now it's hard t

Re: Farewell (of sorts)

2018-10-10 Thread Jonathan M Davis via Digitalmars-d
On Thursday, October 4, 2018 7:15:23 AM MDT Shachar Shemesh via Digitalmars- d wrote: > Hello everyone, > > First of all, I know I've had a shorter than usual fuse of late. I'd > like to apologize to everyone about this. It is the culmination of quite > a few things incr

Re: Passing $ as a function argument

2018-10-10 Thread Simen Kjærås via Digitalmars-d
On Wednesday, 10 October 2018 at 08:46:42 UTC, James Japherson wrote: Would be nice to be able to pass $ as a function argument to be used in automatic path length traversing. void foo(int loc) { return bar[loc]; } then foo($) would essentilly become foo(&) becomes ==> return bar[$

Re: Passing $ as a function argument

2018-10-10 Thread bachmeier via Digitalmars-d
On Wednesday, 10 October 2018 at 08:46:42 UTC, James Japherson wrote: The usefulness comes from the case when bar is local: void foo(int loc) { auto bar = double[RandomPInt+1]; return bar[loc]; } then foo($) always returns a value and the outside world does not need to know about foo

Re: Passing $ as a function argument

2018-10-10 Thread bauss via Digitalmars-d
On Wednesday, 10 October 2018 at 08:46:42 UTC, James Japherson wrote: Would be nice to be able to pass $ as a function argument to be used in automatic path length traversing. void foo(int loc) { return bar[loc]; } then foo($) would essentilly become foo(&) becomes ==> return bar[$

Re: extern(C++, ns) is wrong

2018-10-10 Thread evilrat via Digitalmars-d
On Wednesday, 5 September 2018 at 00:35:50 UTC, Manu wrote: That's all you need really, any symbol you add will cause the error. extern(C++, bliz): created a symbol "bliz", you can't import a package from "bliz" cause then there's a symbol clash. I thought you implemented extern(C++) ...

Re: Using a development branch of druntime+phobos with ldc

2018-10-10 Thread Per Nordlöw via Digitalmars-d
On Wednesday, 10 October 2018 at 10:06:36 UTC, kinke wrote: LDC has its own forks of druntime and Phobos, with numerous required adaptations. So you'd need to apply your patches to those forks & build the libs (druntime and Phobos are separate libs for LDC), e.g., with the included ldc-build-ru

Re: Using a development branch of druntime+phobos with ldc

2018-10-10 Thread kinke via Digitalmars-d
On Wednesday, 10 October 2018 at 08:29:52 UTC, Per Nordlöw wrote: but what about rebuilding druntime+phobos with ldc and linking with that specific libphobos.so when compiling my benchmarking app with ldc? Is it possible? If so, what's the preferred way? LDC has its own forks of druntime and P

Re: Thread-safe attribution

2018-10-10 Thread Kagamin via Digitalmars-d
struct Bob { threadsafe Atomic!(string[string]) y; } void f(ref threadsafe Bob b) { string[string] aa=b.y; aa["b"]="c"; } Like this?

Passing $ as a function argument

2018-10-10 Thread James Japherson via Digitalmars-d
Would be nice to be able to pass $ as a function argument to be used in automatic path length traversing. void foo(int loc) { return bar[loc]; } then foo($) would essentilly become foo(&) becomes ==> return bar[$]; instead of having do to thinks like foo(bar.length). The usefulne

Using a development branch of druntime+phobos with ldc

2018-10-10 Thread Per Nordlöw via Digitalmars-d
I'm experimenting with a new GC at https://github.com/nordlow/druntime/blob/fastalloc-gc/src/gc/impl/fastalloc/gc.d in my druntime branch fastalloc-gc. I've found a way to benchmark it using dmd as outlined at https://forum.dlang.org/post/zjxycchqrnxplkrlm...@forum.dlang.org but what about re

Re: What's going on with the DMD nightlies releases ?

2018-10-09 Thread bauss via Digitalmars-d
On Wednesday, 19 September 2018 at 12:51:25 UTC, Basile B. wrote: The downloads of nightlies is broken since at least 2 weeks now. What's going on ? Someone messed up :(

Re: std.data.json formal review

2018-10-09 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, October 9, 2018 5:45:02 PM MDT Nicholas Wilson via Digitalmars-d wrote: > On Tuesday, 9 October 2018 at 18:07:44 UTC, Márcio Martins wrote: > > On Tuesday, 28 July 2015 at 14:07:19 UTC, Atila Neves wrote: > >> Start of the two week process, folks. > >> >

Re: std.data.json formal review

2018-10-09 Thread Basile B. via Digitalmars-d
On Tuesday, 9 October 2018 at 18:07:44 UTC, Márcio Martins wrote: On Tuesday, 28 July 2015 at 14:07:19 UTC, Atila Neves wrote: Start of the two week process, folks. Code: https://github.com/s-ludwig/std_data_json Docs: http://s-ludwig.github.io/std_data_json/ Atila Sorry for the late ping, b

Re: std.data.json formal review

2018-10-09 Thread Nicholas Wilson via Digitalmars-d
On Tuesday, 9 October 2018 at 18:07:44 UTC, Márcio Martins wrote: On Tuesday, 28 July 2015 at 14:07:19 UTC, Atila Neves wrote: Start of the two week process, folks. Code: https://github.com/s-ludwig/std_data_json Docs: http://s-ludwig.github.io/std_data_json/ Atila Sorry for the late ping, b

Re: std.data.json formal review

2018-10-09 Thread Márcio Martins via Digitalmars-d
On Tuesday, 28 July 2015 at 14:07:19 UTC, Atila Neves wrote: Start of the two week process, folks. Code: https://github.com/s-ludwig/std_data_json Docs: http://s-ludwig.github.io/std_data_json/ Atila Sorry for the late ping, but it's been 3 years - what has happened to this? Has it been forg

Re: Deep nesting vs early returns

2018-10-09 Thread Johan Engelen via Digitalmars-d
On Tuesday, 2 October 2018 at 18:14:55 UTC, Andrei Alexandrescu wrote: Kate Gregory makes a good argument on something I've often commented in code reviews: https://youtu.be/n0Ak6xtVXno?t=2682 I very much like LLVM's practices, and one of them is it's Coding Standards. It prescribes early ret

Re: Thread-safe attribution

2018-10-08 Thread Stefan Koch via Digitalmars-d
On Sunday, 7 October 2018 at 02:59:12 UTC, Manu wrote: On Sat, Oct 6, 2018 at 7:40 PM Nicholas Wilson via Digitalmars-d wrote: [...] One thing that occurred to me is that _objects_ are shared, whereas _functions/methods_ (and their parameters) are thread safe . Theadsafe is kind of like

Re: Deep nesting vs early returns

2018-10-08 Thread Stanislav Blinov via Digitalmars-d
On Friday, 5 October 2018 at 21:34:38 UTC, Jonathan M Davis wrote: It's one of those things that I would have thought would just be obvious with experience, but if nothing else, some folks still try to stick to the whole "single return" idea even though I think that most folks agree at this po

Re: Help needed for D support in SCons on Windows

2018-10-08 Thread Russel Winder via Digitalmars-d
On Sun, 2018-10-07 at 10:51 +, rjframe via Digitalmars-d wrote: […] > > I don't use SCons, but took a quick look; my current guess is that the > problem is the chocolatey installation of dmd and the rest in AppVeyor; > chocolatey doesn't install DMD in %SYSTEMROOT% a

Re: DUB??

2018-10-07 Thread Anton Fediushin via Digitalmars-d
On Monday, 8 October 2018 at 05:23:33 UTC, bauss wrote: On Saturday, 6 October 2018 at 20:27:07 UTC, Basile B wrote: On Saturday, 6 October 2018 at 19:07:48 UTC, steven kladitis wrote: On Saturday, 6 October 2018 at 17:48:00 UTC, rikki cattermole wrote: On 07/10/2018 6:36 AM, steven kladitis w

Re: DUB??

2018-10-07 Thread bauss via Digitalmars-d
On Saturday, 6 October 2018 at 20:27:07 UTC, Basile B wrote: On Saturday, 6 October 2018 at 19:07:48 UTC, steven kladitis wrote: On Saturday, 6 October 2018 at 17:48:00 UTC, rikki cattermole wrote: On 07/10/2018 6:36 AM, steven kladitis wrote: [...] 1.11.0 is current https://github.com/dlang

Re: Thread-safe attribution

2018-10-07 Thread Manu via Digitalmars-d
On Sun, Oct 7, 2018 at 10:00 AM Boris-Barboris via Digitalmars-d wrote: > > On Sunday, 7 October 2018 at 02:01:17 UTC, Manu wrote: > > ... but I'm really struggling > > to express it in terms of the type system... > > I'm pretty sure no simple attribute system

Re: Thread-safe attribution

2018-10-07 Thread Boris-Barboris via Digitalmars-d
On Sunday, 7 October 2018 at 02:01:17 UTC, Manu wrote: ... but I'm really struggling to express it in terms of the type system... I'm pretty sure no simple attribute system is any more useful than current const\shared idiom. I am yet to see a language with semantics that actually help with co

Re: Thread-safe attribution

2018-10-07 Thread Stanislav Blinov via Digitalmars-d
On Sunday, 7 October 2018 at 04:16:43 UTC, Manu wrote: We're not trying to 'stuff the nuances' into a keyword... what I'm trying to achieve is a mechanism for attributing that a function has implemented thread-safety *in some way*, and how that works is a detail for the function. What the attr

Re: Help needed for D support in SCons on Windows

2018-10-07 Thread rjframe via Digitalmars-d
On Tue, 02 Oct 2018 06:51:10 +0100, Russel Winder wrote: > It turns out there are a number problems with the SCons tests running on > Windows, many of them associated with the D support. > > https://github.com/SCons/scons/issues/3205 > > As you will see I am choosing not to get involved in anyth

Re: Thread-safe attribution

2018-10-06 Thread Manu via Digitalmars-d
On Sat, Oct 6, 2018 at 8:10 PM Stanislav Blinov via Digitalmars-d wrote: > > On Sunday, 7 October 2018 at 02:01:17 UTC, Manu wrote: > > >> The thing I'm trying to model is an attribute along the lines > >> of > >> `shared`, but actually useful ;) > >

Re: Thread-safe attribution

2018-10-06 Thread Stanislav Blinov via Digitalmars-d
On Sunday, 7 October 2018 at 02:01:17 UTC, Manu wrote: The thing I'm trying to model is an attribute along the lines of `shared`, but actually useful ;) I'll use the attribute `threadsafe` in place of `shared`, and see where that goes. Consider: struct Bob { int x; threadsafe Atomic!int

Re: Thread-safe attribution

2018-10-06 Thread Manu via Digitalmars-d
On Sat, Oct 6, 2018 at 7:01 PM Manu wrote: > > On Sat, Oct 6, 2018 at 6:59 PM Manu wrote: > > > > So I'm working on a SMT infrastructure, and expression of > > thread-safety is a core design mechanic... but I'm really struggling > > to express it in terms of the type system. > > I figure I'll thr

Re: Thread-safe attribution

2018-10-06 Thread Manu via Digitalmars-d
On Sat, Oct 6, 2018 at 7:40 PM Nicholas Wilson via Digitalmars-d wrote: > > [...] > > One thing that occurred to me is that _objects_ are shared, > whereas _functions/methods_ (and their parameters) are thread > safe . > > Theadsafe is kind of like a const (as to mutable/i

Re: Thread-safe attribution

2018-10-06 Thread Nicholas Wilson via Digitalmars-d
On Sunday, 7 October 2018 at 01:59:21 UTC, Manu wrote: So I'm working on a SMT infrastructure, and expression of thread-safety is a core design mechanic... but I'm really struggling to express it in terms of the type system. I figure I'll throw some design challenges out here and see if anyone

Re: Thread-safe attribution

2018-10-06 Thread Manu via Digitalmars-d
On Sat, Oct 6, 2018 at 6:59 PM Manu wrote: > > So I'm working on a SMT infrastructure, and expression of > thread-safety is a core design mechanic... but I'm really struggling > to express it in terms of the type system. > I figure I'll throw some design challenges out here and see if anyone > can

Thread-safe attribution

2018-10-06 Thread Manu via Digitalmars-d
So I'm working on a SMT infrastructure, and expression of thread-safety is a core design mechanic... but I'm really struggling to express it in terms of the type system. I figure I'll throw some design challenges out here and see if anyone can offer some good ideas. The thing I'm trying to model i

Re: DUB??

2018-10-06 Thread Basile B via Digitalmars-d
On Saturday, 6 October 2018 at 19:07:48 UTC, steven kladitis wrote: On Saturday, 6 October 2018 at 17:48:00 UTC, rikki cattermole wrote: On 07/10/2018 6:36 AM, steven kladitis wrote: [...] 1.11.0 is current https://github.com/dlang/dub/tree/v1.11.0 [...] Do you mean code.dlang.org not dub

Re: Deep nesting vs early returns

2018-10-06 Thread Paolo Invernizzi via Digitalmars-d
On Saturday, 6 October 2018 at 18:55:48 UTC, Patrick Schluter wrote: On Saturday, 6 October 2018 at 05:36:59 UTC, Paolo Invernizzi wrote: [...] In the 90s I used to add the C preprocessor to other languages which lacked efficient constant definition (i.e. compile time constructs). AutoLISP, th

Re: DUB??

2018-10-06 Thread steven kladitis via Digitalmars-d
On Saturday, 6 October 2018 at 17:48:00 UTC, rikki cattermole wrote: On 07/10/2018 6:36 AM, steven kladitis wrote: what has happened to dub? 1.11 is current or so it says, but I see 1.9.x and when I click on dub in dub I get vibe errors. What has happened? 1.11.0 is current https://github.com

Re: Deep nesting vs early returns

2018-10-06 Thread Patrick Schluter via Digitalmars-d
On Saturday, 6 October 2018 at 05:36:59 UTC, Paolo Invernizzi wrote: On Friday, 5 October 2018 at 19:04:26 UTC, Nick Sabalausky (Abscissa) wrote: On 10/04/2018 11:40 PM, rikki cattermole wrote: [...] It's not *my* statement about newer/older. If you recall the programming atmosphere around 2

Re: This is why I don't use D.

2018-10-06 Thread Neia Neutuladh via Digitalmars-d
On 10/06/2018 01:38 AM, 0xEAB wrote: The "tests" check doesn't seem to work properly for DMD <= v2.072.0. If one looks at the reports[0] for those compilers, one will that pretty everything failed. For example, `discord-rpc`[1] doesn't even have any unittests. I'm clearing out those build re

Benchmarking framework that measures min and max

2018-10-06 Thread Nordlöw via Digitalmars-d
Have anybody put together an alternative to std.datetime.benchmark() that measures not only total amount of time passed for n calls to a single or multiple functions but also the minimum and maximum time for all the calls to each function.

Re: DUB??

2018-10-06 Thread rikki cattermole via Digitalmars-d
On 07/10/2018 6:36 AM, steven kladitis wrote: what has happened to dub? 1.11 is current or so it says, but I see 1.9.x and when I click on dub in dub I get vibe errors. What has happened? 1.11.0 is current https://github.com/dlang/dub/tree/v1.11.0 for DUB I always see 500 - Internal Server E

DUB??

2018-10-06 Thread steven kladitis via Digitalmars-d
what has happened to dub? 1.11 is current or so it says, but I see 1.9.x and when I click on dub in dub I get vibe errors. What has happened? for DUB I always see 500 - Internal Server Error Internal Server Error Internal error information: vibe.db.mongo.connection.MongoDriverException@../..

Re: Forums intermittently going down?

2018-10-06 Thread Basile B via Digitalmars-d
On Saturday, 6 October 2018 at 09:29:42 UTC, Jacob Carlborg wrote: Just see what has happened to the DMD nightly builds. It's been down for weeks (soon a month?) I've checked the logs from my stuff at Semaphore and it's since Sept 7 to be exactly.

Re: Forums intermittently going down?

2018-10-06 Thread Jacob Carlborg via Digitalmars-d
On 2018-10-05 22:32, H. S. Teoh wrote: Yes, and have it go down when things like the infamous AWS Outage happens. Centralization is evil. How is having single server (I assume) behind a single ISP any less centralization than a cloud provider? Another advantage of using the cloud is that i

Re: Forums intermittently going down?

2018-10-06 Thread Jacob Carlborg via Digitalmars-d
On 2018-10-05 22:32, H. S. Teoh wrote: Yes, and have it go down when things like the infamous AWS Outage happens. Centralization is evil. And you think that cannot happen when you're managing the hardware yourself? If you're hardware is not failing you're ISP still can. If you're really par

Re: This is why I don't use D.

2018-10-06 Thread 0xEAB via Digitalmars-d
On Friday, 21 September 2018 at 22:26:11 UTC, Neia Neutuladh wrote: On Friday, 21 September 2018 at 20:49:54 UTC, 0xEAB wrote: On Thursday, 20 September 2018 at 17:06:43 UTC, Neia Neutuladh wrote: The tester is now submodule-aware and I removed builds for packages with a `.gitmodules` file. I

Re: Deep nesting vs early returns

2018-10-05 Thread Paolo Invernizzi via Digitalmars-d
On Friday, 5 October 2018 at 19:04:26 UTC, Nick Sabalausky (Abscissa) wrote: On 10/04/2018 11:40 PM, rikki cattermole wrote: [...] It's not *my* statement about newer/older. If you recall the programming atmosphere around 2000, OO was widely being touted as a newer thing, superior to "old-fa

Re: Deep nesting vs early returns

2018-10-05 Thread Tobias Müller via Digitalmars-d
H. S. Teoh wrote: > I've had to work with code that had multiply-nested #define macros > involving `do {} while(0)`, and have hated every minute of it. Yes it's ugly but it's also the only way to define a multi-statement macro that can be used like a function. --- Tobias

Re: Deep nesting vs early returns

2018-10-05 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, October 2, 2018 12:14:55 PM MDT Andrei Alexandrescu via Digitalmars-d wrote: > Kate Gregory makes a good argument on something I've often commented in > code reviews: https://youtu.be/n0Ak6xtVXno?t=2682 It's one of those things that I would have thought would just

Re: Forums intermittently going down?

2018-10-05 Thread H. S. Teoh via Digitalmars-d
On Fri, Oct 05, 2018 at 07:35:11PM +, AlCaponeJr via Digitalmars-d wrote: > On Friday, 5 October 2018 at 16:11:05 UTC, H. S. Teoh wrote: > > On Thu, Oct 04, 2018 at 11:51:02PM +, Vladimir Panteleev via > > Digitalmars-d wrote: [...] > > > Yeah, painfully aware. I&#

Re: Deep nesting vs early returns

2018-10-05 Thread H. S. Teoh via Digitalmars-d
On Fri, Oct 05, 2018 at 08:00:03PM +, Patrick Schluter via Digitalmars-d wrote: > On Friday, 5 October 2018 at 16:02:49 UTC, Nick Treleaven wrote: > > On Thursday, 4 October 2018 at 06:43:02 UTC, Gopan wrote: [...] > > > while(1) > > > { > > > ... >

Re: Deep nesting vs early returns

2018-10-05 Thread Rémy Mouëza via Digitalmars-d
On Tuesday, 2 October 2018 at 18:14:55 UTC, Andrei Alexandrescu wrote: Kate Gregory makes a good argument on something I've often commented in code reviews: https://youtu.be/n0Ak6xtVXno?t=2682 I've found a good explanation for the reason behind nesting here: https://softwareengineering.stackexc

Re: Deep nesting vs early returns

2018-10-05 Thread Patrick Schluter via Digitalmars-d
On Friday, 5 October 2018 at 16:02:49 UTC, Nick Treleaven wrote: On Thursday, 4 October 2018 at 06:43:02 UTC, Gopan wrote: I have seen people enclosing the function logic inside a while(1) merely to stick on to single return at the end. while(1) { ... break; //otherwise return

Re: Forums intermittently going down?

2018-10-05 Thread AlCaponeJr via Digitalmars-d
On Friday, 5 October 2018 at 16:11:05 UTC, H. S. Teoh wrote: On Thu, Oct 04, 2018 at 11:51:02PM +, Vladimir Panteleev via Digitalmars-d wrote: On Thursday, 4 October 2018 at 19:18:15 UTC, JN wrote: > Seems like the issues with the forum got worse. It's hardly > usable today,

Re: Deep nesting vs early returns

2018-10-05 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 10/04/2018 11:40 PM, rikki cattermole wrote: On 05/10/2018 8:23 AM, Nick Sabalausky (Abscissa) wrote: I was in college during the height of the Java craze, so my instructors highly recommended the deep nesting approach. This was because return statements are control-flow, and control-flow is

Re: What's going on with the DMD nightlies releases ?

2018-10-05 Thread Andre Pany via Digitalmars-d
On Wednesday, 19 September 2018 at 12:51:25 UTC, Basile B. wrote: The downloads of nightlies is broken since at least 2 weeks now. What's going on ? Unfortunately it is still broken that is the reason why all dub pull requests are marked as failed. Example https://ci.appveyor.com/project/s-l

Re: Forums intermittently going down?

2018-10-05 Thread H. S. Teoh via Digitalmars-d
On Thu, Oct 04, 2018 at 11:51:02PM +, Vladimir Panteleev via Digitalmars-d wrote: > On Thursday, 4 October 2018 at 19:18:15 UTC, JN wrote: > > Seems like the issues with the forum got worse. It's hardly usable > > today, most of the time I am being greeted by "forums

Re: Deep nesting vs early returns

2018-10-05 Thread Nick Treleaven via Digitalmars-d
On Thursday, 4 October 2018 at 06:43:02 UTC, Gopan wrote: I have seen people enclosing the function logic inside a while(1) merely to stick on to single return at the end. while(1) { ... break; //otherwise return would come here. ... break; } return ...; I th

Re: Deep nesting vs early returns

2018-10-05 Thread Claude via Digitalmars-d
On Thursday, 4 October 2018 at 06:43:02 UTC, Gopan wrote: Any advices? In C, I will layout my functions like that (that's especially good for initializer functions): int init(struct my_handle *handle, ...) { if (handle == NULL) return -EINVAL; // direct return for parameter safety che

Re: LDC2 1.9.0 beta 1 bug

2018-10-05 Thread Steven Schveighoffer via Digitalmars-d
On 10/5/18 5:41 AM, Kagamin wrote: On Thursday, 4 October 2018 at 12:51:27 UTC, Shachar Shemesh wrote: More to the point, however, expanding the call to the second form means that I can *never* supply non-default values to arg1 and arg2. You wrote it yourself: f!()(true, 'S') This is a terri

Re: Warn on unused imports?

2018-10-05 Thread JN via Digitalmars-d
On Wednesday, 3 October 2018 at 17:33:43 UTC, Dennis wrote: Sure, the Unix way is a nice philosophy, but let's face the facts: - Because of (amongst others) CTFE and mixin, D is an incredibly complicated language to reason about (unlike Java or C#) - There is only one D front-end, and it will l

Re: LDC2 1.9.0 beta 1 bug

2018-10-05 Thread Kagamin via Digitalmars-d
On Thursday, 4 October 2018 at 12:51:27 UTC, Shachar Shemesh wrote: More to the point, however, expanding the call to the second form means that I can *never* supply non-default values to arg1 and arg2. You wrote it yourself: f!()(true, 'S')

Re: Warn on unused imports?

2018-10-05 Thread Patrick Schluter via Digitalmars-d
On Thursday, 4 October 2018 at 18:55:01 UTC, Nick Sabalausky (Abscissa) wrote: On 09/26/2018 06:00 AM, Anonymouse wrote: On Tuesday, 25 September 2018 at 13:03:30 UTC, FeepingCreature wrote: I'm playing with a branch of DMD that would warn on unused imports: Would just like to say that I love

Re: Deep nesting vs early returns

2018-10-04 Thread rikki cattermole via Digitalmars-d
On 05/10/2018 8:23 AM, Nick Sabalausky (Abscissa) wrote: I was in college during the height of the Java craze, so my instructors highly recommended the deep nesting approach. This was because return statements are control-flow, and control-flow isn't very object-orientedy, and is old-fasioned a

Re: Forums intermittently going down?

2018-10-04 Thread Vladimir Panteleev via Digitalmars-d
On Thursday, 4 October 2018 at 19:18:15 UTC, JN wrote: Seems like the issues with the forum got worse. It's hardly usable today, most of the time I am being greeted by "forums are being overloaded" message. Yeah, painfully aware. I've been trying a bunch of different things all day, and looks

Re: Deep nesting vs early returns

2018-10-04 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 10/02/2018 02:14 PM, Andrei Alexandrescu wrote: Kate Gregory makes a good argument on something I've often commented in code reviews: https://youtu.be/n0Ak6xtVXno?t=2682 I was in college during the height of the Java craze, so my instructors highly recommended the deep nesting approach. Thi

Re: Forums intermittently going down?

2018-10-04 Thread JN via Digitalmars-d
On Wednesday, 26 September 2018 at 02:33:27 UTC, Vladimir Panteleev wrote: fixed this by limiting the check to the first unread post instead of reusing a function to count all unread messages in the subscription queue: https://github.com/cybershadow/DFeed/commit/9cfcab2 Seems like the issues

Re: Warn on unused imports?

2018-10-04 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 09/26/2018 06:00 AM, Anonymouse wrote: On Tuesday, 25 September 2018 at 13:03:30 UTC, FeepingCreature wrote: I'm playing with a branch of DMD that would warn on unused imports: Would just like to say that I love the idea and would use it immediately. Same here. Periodically, my import li

Re: Please don't do a DConf 2018, consider alternatives

2018-10-04 Thread rjframe via Digitalmars-d
On Tue, 02 Oct 2018 14:49:31 +, bachmeier wrote: > I think this is something that could be done *in addition to* DConf. I > honestly don't think DConf is very effective at promoting D, except > perhaps to a small sliver of the overall population of programmers, due > to the content of most of

Re: LDC2 1.9.0 beta 1 bug

2018-10-04 Thread Steven Schveighoffer via Digitalmars-d
On 10/4/18 8:51 AM, Shachar Shemesh wrote: I got this as a report from a user, not directly running this, which is why I'm not opening a bug report. Consider the following function: void f(ARGS...)(ARGS args, bool arg1 = true, char arg2 = 'H'); Now consider the following call to it:   f(true,

Re: Farewell (of sorts)

2018-10-04 Thread Nicholas Wilson via Digitalmars-d
On Thursday, 4 October 2018 at 13:15:23 UTC, Shachar Shemesh wrote: Hello everyone, First of all, I know I've had a shorter than usual fuse of late. I'd like to apologize to everyone about this. It is the culmination of quite a few things increasing the load I'm under. One of those things is

Re: Farewell (of sorts)

2018-10-04 Thread bauss via Digitalmars-d
On Thursday, 4 October 2018 at 13:15:23 UTC, Shachar Shemesh wrote: Hello everyone, First of all, I know I've had a shorter than usual fuse of late. I'd like to apologize to everyone about this. It is the culmination of quite a few things increasing the load I'm under. One of those things is

Re: DIP 1014

2018-10-04 Thread Stanislav Blinov via Digitalmars-d
On Thursday, 4 October 2018 at 12:08:38 UTC, Shachar Shemesh wrote: Two distinct things. Kinke was talking about how to pass a struct through the ABI. You are talking about special-casing a specific name. Not just name, but argument passing as well. Not to mention, your special case is to t

Farewell (of sorts)

2018-10-04 Thread Shachar Shemesh via Digitalmars-d
Hello everyone, First of all, I know I've had a shorter than usual fuse of late. I'd like to apologize to everyone about this. It is the culmination of quite a few things increasing the load I'm under. One of those things is this: October 14th will be my last day working for Weka.IO. Accordi

Re: LDC2 1.9.0 beta 1 bug

2018-10-04 Thread Nemanja Boric via Digitalmars-d
On Thursday, 4 October 2018 at 12:51:27 UTC, Shachar Shemesh wrote: I got this as a report from a user, not directly running this, which is why I'm not opening a bug report. [...] I'm pretty sure I saw an issue in bugzilla few weeks ago... Found it: https://issues.dlang.org/show_bug.cgi?id

LDC2 1.9.0 beta 1 bug

2018-10-04 Thread Shachar Shemesh via Digitalmars-d
I got this as a report from a user, not directly running this, which is why I'm not opening a bug report. Consider the following function: void f(ARGS...)(ARGS args, bool arg1 = true, char arg2 = 'H'); Now consider the following call to it: f(true, 'S'); Theoretically, this can either be cal

Re: DIP 1014

2018-10-04 Thread Shachar Shemesh via Digitalmars-d
On 04/10/18 13:43, Stanislav Blinov wrote: * move the data as part of the call hook rather than before * Use a different name and signature on the hook function Yes, exactly. It would have to be special if you don't want to leave room for the compiler implementors. That's not how standa

Re: Deep nesting vs early returns

2018-10-04 Thread Jacob Carlborg via Digitalmars-d
On Thursday, 4 October 2018 at 06:43:02 UTC, Gopan wrote: Certain people recommend that there be only one return statement (usually at the end) from a function. The said advantage is that, in a maintenance code, if you later want to do something before returning, you can add it just above the

Re: Deep nesting vs early returns

2018-10-04 Thread Jacob Carlborg via Digitalmars-d
On Tuesday, 2 October 2018 at 20:53:40 Is it: For optional binding, Swift 2 has sugar for if let !( ){} Or am I missing the point of the guard statement? The variable declared in the guard statement is available after the statement. It’s like an if statement without the then part, only an e

Re: DIP 1014

2018-10-04 Thread Stanislav Blinov via Digitalmars-d
On Thursday, 4 October 2018 at 08:32:44 UTC, Shachar Shemesh wrote: On 04/10/18 11:16, Paolo Invernizzi wrote: While I want to thank you both, about the quality of this thread, what kind of "consequences that go beyond what I think you understand" are you thinking of? Can you give an example?

Re: Please don't do a DConf 2018, consider alternatives

2018-10-04 Thread Joakim via Digitalmars-d
On Thursday, 4 October 2018 at 10:02:28 UTC, Russel Winder wrote: On Thu, 2018-10-04 at 08:06 +, Joakim via Digitalmars-d wrote: […] The link in my OP links to a guy who maintained a spreadsheet of Apple-related conferences as evidence. He lists several that went away and says nothing

Re: Please don't do a DConf 2018, consider alternatives

2018-10-04 Thread Russel Winder via Digitalmars-d
On Thu, 2018-10-04 at 08:06 +, Joakim via Digitalmars-d wrote: > […] > > The link in my OP links to a guy who maintained a spreadsheet of > Apple-related conferences as evidence. He lists several that went > away and says nothing replaced them. If you don't even exa

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