Re: Beta 2.082.0

2018-10-17 Thread Vladimir Panteleev via Digitalmars-d-announce
On Wednesday, 17 October 2018 at 12:14:55 UTC, Martin Nowak wrote: Glad to announce the first beta for the 2.083.0 release, ♥ to the 48 contributors for this release. Thanks! CppRuntime_* version identifiers - https://dlang.org/changelog/2.083.0.html#cppVersions When is this different from

Re: shared - i need it to be useful

2018-10-17 Thread Steven Schveighoffer via Digitalmars-d
On 10/17/18 10:18 AM, Timon Gehr wrote: On 17.10.2018 15:40, Steven Schveighoffer wrote: On 10/17/18 8:02 AM, Timon Gehr wrote: Now, if a class has only shared members, that is another story. In this case, all references should implicitly convert to shared. There's a DIP I meant to write

why is the default floating point value NAN ?

2018-10-17 Thread Codifies via Digitalmars-d-learn
I'd have thought it ought to be 0.0 ? So far I seen carefully considered and sensible reasons for doing things in D, so why NAN ?

Re: Beta 2.082.0

2018-10-17 Thread Andre Pany via Digitalmars-d-announce
On Wednesday, 17 October 2018 at 15:18:43 UTC, Vladimir Panteleev wrote: On Wednesday, 17 October 2018 at 12:14:55 UTC, Martin Nowak wrote: Glad to announce the first beta for the 2.083.0 release, ♥ to the 48 contributors for this release. Thanks! CppRuntime_* version identifiers -

Re: Beta 2.082.0

2018-10-17 Thread Nicholas Wilson via Digitalmars-d-announce
On Wednesday, 17 October 2018 at 15:18:43 UTC, Vladimir Panteleev wrote: On Wednesday, 17 October 2018 at 12:14:55 UTC, Martin Nowak wrote: Glad to announce the first beta for the 2.083.0 release, ♥ to the 48 contributors for this release. Thanks! CppRuntime_* version identifiers -

Re: why is the default floating point value NAN ?

2018-10-17 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 17 October 2018 at 15:48:16 UTC, Codifies wrote: I'd have thought it ought to be 0.0 ? So far I seen carefully considered and sensible reasons for doing things in D, so why NAN ? You are supposed to initialize your own variables explicitly. NaN is a somewhat easy way to

Re: shared - i need it to be useful

2018-10-17 Thread Steven Schveighoffer via Digitalmars-d
On 10/17/18 9:58 AM, Nicholas Wilson wrote: On Wednesday, 17 October 2018 at 13:25:28 UTC, Steven Schveighoffer wrote: It's identical to the top one. You now have a new unshared reference to shared data. This is done WITHOUT any agreed-upon synchronization. It isn't, you typo'd it (I

Re: Interfacing D with C: Arrays Part 1

2018-10-17 Thread David Gileadi via Digitalmars-d-announce
On 10/17/18 8:20 AM, Mike Parker wrote: I had intended to publish the next GC series post early this month, but after many revisions and discussions with a couple of reviewers, I've decided to put it on hold until something gets worked out about the conflation of destruction and finalization

Re: shared - i need it to be useful

2018-10-17 Thread Steven Schveighoffer via Digitalmars-d
On 10/17/18 12:27 PM, Nicholas Wilson wrote: On Wednesday, 17 October 2018 at 15:51:04 UTC, Steven Schveighoffer wrote: On 10/17/18 9:58 AM, Nicholas Wilson wrote: On Wednesday, 17 October 2018 at 13:25:28 UTC, Steven Schveighoffer wrote: It's identical to the top one. You now have a new

Re: No D bindings in Atom editor

2018-10-17 Thread Laurent Tréguier via Digitalmars-d
On Tuesday, 16 October 2018 at 02:34:47 UTC, Jabari Zakiya wrote: Just updated Atom editor and noticed D files read as plain .txt and no D bindings in list of programs. Maybe someone should bring that to Atom's devs attention. Interesting, since my main editor, KDE's Kate, does have D file

Re: shared - i need it to be useful

2018-10-17 Thread Nicholas Wilson via Digitalmars-d
On Wednesday, 17 October 2018 at 15:51:04 UTC, Steven Schveighoffer wrote: On 10/17/18 9:58 AM, Nicholas Wilson wrote: On Wednesday, 17 October 2018 at 13:25:28 UTC, Steven Schveighoffer wrote: It's identical to the top one. You now have a new unshared reference to shared data. This is done

Interfacing D with C: Arrays Part 1

2018-10-17 Thread Mike Parker via Digitalmars-d-announce
I had intended to publish the next GC series post early this month, but after many revisions and discussions with a couple of reviewers, I've decided to put it on hold until something gets worked out about the conflation of destruction and finalization in D (something I'll be pushing for

Re: shared - i need it to be useful

2018-10-17 Thread Stanislav Blinov via Digitalmars-d
On Wednesday, 17 October 2018 at 14:14:56 UTC, Nicholas Wilson wrote: On Wednesday, 17 October 2018 at 07:24:13 UTC, Stanislav Blinov wrote: On Wednesday, 17 October 2018 at 05:40:41 UTC, Walter Bright wrote: When Andrei and I came up with the rules for: mutable const shared

Re: betterC generate dynamic array throw Error: TypeInfo cannot be used with -betterC

2018-10-17 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 17 October 2018 at 07:01:21 UTC, test wrote: test1: module test1; import test2; enum X = getR(1,3); void main(string[] args){} test2: module test2; struct R { int i; } R[] getR(int a, int b){ R[] r; r ~=

Re: shared - i need it to be useful

2018-10-17 Thread Manu via Digitalmars-d
On Wed, Oct 17, 2018 at 10:30 AM Steven Schveighoffer via Digitalmars-d wrote: > > On 10/17/18 12:27 PM, Nicholas Wilson wrote: > > On Wednesday, 17 October 2018 at 15:51:04 UTC, Steven Schveighoffer wrote: > >> On 10/17/18 9:58 AM, Nicholas Wilson wrote: > >>> On Wednesday, 17 October 2018 at

Re: Beta 2.082.0

2018-10-17 Thread JN via Digitalmars-d-announce
On Wednesday, 17 October 2018 at 12:14:55 UTC, Martin Nowak wrote: Glad to announce the first beta for the 2.083.0 release, ♥ to BTW, title says Beta 2.082.0 :)

DMD Linker Issue on Windows

2018-10-17 Thread Kai via Digitalmars-d
Hi, I just ran into this linker issue (see answer below that I grabbed from the vibe.d forum) as well - where can I ask/track about the progress on this issue? Thanks! "This is currently an unfortunate limitation on Windows, where the DigitalMars linker runs into a crash when building with

Re: custom sorting of lists ?

2018-10-17 Thread Carl Sturtivant via Digitalmars-d-learn
On Monday, 15 October 2018 at 13:39:59 UTC, Steven Schveighoffer wrote: But that's just the thing -- merge sort *does* depend on the container type. It requires the ability to rearrange the elements structurally, since you merge the sets of items together. This requires making another list

Re: Beta 2.082.0

2018-10-17 Thread Neia Neutuladh via Digitalmars-d-announce
On Wednesday, 17 October 2018 at 14:02:20 UTC, Jesse Phillips wrote: Wait, why does each get a special bailout? Doesn't until full that role? `until` is lazy. We could have `doUntil` instead, which would be eager and would return a boolean indicating whether to continue. We could all write

Re: why is the default floating point value NAN ?

2018-10-17 Thread Dennis via Digitalmars-d-learn
On Wednesday, 17 October 2018 at 15:51:21 UTC, Codifies wrote: okay I should have carried on reading the blog, its so uninitialized values stick out when debugging... Indeed, the initial value is not supposed to be useful, it's there because dealing with garbage memory when forgetting to

Re: DMD Linker Issue on Windows

2018-10-17 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 17 October 2018 at 17:37:37 UTC, Kai wrote: I just ran into this linker issue (see answer below that I grabbed from the vibe.d forum) as well - where can I ask/track about the progress on this issue? Do you have the new dmd installed? Using the x86_64 should work now if all

Re: Who can stop it ? Help me,thank you.

2018-10-17 Thread Tony via Digitalmars-d-learn
On Wednesday, 17 October 2018 at 14:06:49 UTC, FrankLike wrote: Where can get the new dmd or ldc2 that's no 'Trojan horse virus' ? https://dlang.org/download.html

Re: why is the default floating point value NAN ?

2018-10-17 Thread Codifies via Digitalmars-d-learn
On Wednesday, 17 October 2018 at 15:48:16 UTC, Codifies wrote: I'd have thought it ought to be 0.0 ? So far I seen carefully considered and sensible reasons for doing things in D, so why NAN ? okay I should have carried on reading the blog, its so uninitialized values stick out when

Re: shared - i need it to be useful

2018-10-17 Thread Steven Schveighoffer via Digitalmars-d
On 10/17/18 10:33 AM, Nicholas Wilson wrote: On Wednesday, 17 October 2018 at 14:26:43 UTC, Timon Gehr wrote: On 17.10.2018 16:14, Nicholas Wilson wrote: I was thinking that mutable -> shared const as apposed to mutable -> shared would get around the issues that Timon posted. Unfortunately

Re: Dealing with ranges where front and popFront do the same logic / eager ranges

2018-10-17 Thread Dennis via Digitalmars-d-learn
On Wednesday, 17 October 2018 at 00:12:13 UTC, H. S. Teoh wrote: I'm not sure what's the reasoning behind the saying that throwing exceptions in ctors is bad, but exceptions are exactly the kind of thing designed for handling this sort of situation. If the parser detects a problem early (i.e.,

Re: shared - i need it to be useful

2018-10-17 Thread Stanislav Blinov via Digitalmars-d
On Wednesday, 17 October 2018 at 14:44:19 UTC, Guillaume Piolat wrote: The fact that this _type constructor_ finds its way into _identifiers_ create some concern: https://github.com/dlang/phobos/blob/656798f2b385437c239246b59e0433148190938c/std/experimental/allocator/package.d#L642 Well,

Re: betterC generate dynamic array throw Error: TypeInfo cannot be used with -betterC

2018-10-17 Thread test via Digitalmars-d-learn
On Wednesday, 17 October 2018 at 16:50:36 UTC, Paul Backus wrote: On Wednesday, 17 October 2018 at 07:01:21 UTC, test wrote: simple example: you can not use functionAttributes from betterC

Documents about ddoc? and markdown in ddoc?

2018-10-17 Thread dangbinghoo via Digitalmars-d-learn
hi, Is there any other documents related about ddoc usage? the only thing I can find is: https://dlang.org/spec/ddoc.html#using_ddoc_to_generate_examples But I found it never mentioned something like $(LI a list item), is there a full ddoc document available? And, is there any info

Re: Spasm - webassembly libary for single page applications

2018-10-17 Thread aberba via Digitalmars-d-announce
On Tuesday, 16 October 2018 at 07:57:12 UTC, Sebastiaan Koppe wrote: On Tuesday, 16 October 2018 at 03:23:21 UTC, Jesse Phillips wrote: It would be cool if D provided the easiest way to develop webasm first to see if it could claim that market. If you have some minutes to spare it would be

Re: shared - i need it to be useful

2018-10-17 Thread Manu via Digitalmars-d
On Wed, Oct 17, 2018 at 6:50 PM Steven Schveighoffer via Digitalmars-d wrote: > > On 10/17/18 6:37 PM, Manu wrote: > > On Wed, Oct 17, 2018 at 12:35 PM Steven Schveighoffer via > > Digitalmars-d wrote: > >> > >> On 10/17/18 2:46 PM, Manu wrote: > >>> On Wed, Oct 17, 2018 at 10:30 AM Steven

Re: shared - i need it to be useful

2018-10-17 Thread Manu via Digitalmars-d
On Wed, Oct 17, 2018 at 6:15 AM Timon Gehr via Digitalmars-d wrote: > > On 17.10.2018 14:24, Timon Gehr wrote: > > and unshared methods are only allowed to access unshared members. > > This is actually not necessary, let me reformulate: > > You want: > > - if you have a C c and a shared(C) s,

[Issue 11174] Both AF_PACKET and SO_BINDTODEVICE undefined

2018-10-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11174 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/d7b855a0f816b9e376ecfb187dd618be90a8d8d7 Fix Issue 11174 - Define non-standard address

[Issue 11174] Both AF_PACKET and SO_BINDTODEVICE undefined

2018-10-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11174 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

Re: shared - i need it to be useful

2018-10-17 Thread Joakim via Digitalmars-d
On Wednesday, 17 October 2018 at 23:12:48 UTC, Manu wrote: On Wed, Oct 17, 2018 at 2:15 PM Stanislav Blinov via Digitalmars-d wrote: On Wednesday, 17 October 2018 at 19:25:33 UTC, Manu wrote: > On Wed, Oct 17, 2018 at 12:05 PM Stanislav Blinov via > Digitalmars-d wrote: >> >> On Wednesday,

Re: shared - i need it to be useful

2018-10-17 Thread Manu via Digitalmars-d
On Wed, Oct 17, 2018 at 12:05 PM Stanislav Blinov via Digitalmars-d wrote: > > On Wednesday, 17 October 2018 at 18:46:18 UTC, Manu wrote: > > > I've said this a bunch of times, there are 2 rules: > > 1. shared inhibits read and write access to members > > 2. `shared` methods must be threadsafe >

Re: shared - i need it to be useful

2018-10-17 Thread Stanislav Blinov via Digitalmars-d
On Wednesday, 17 October 2018 at 19:25:33 UTC, Manu wrote: On Wed, Oct 17, 2018 at 12:05 PM Stanislav Blinov via Digitalmars-d wrote: On Wednesday, 17 October 2018 at 18:46:18 UTC, Manu wrote: > I've said this a bunch of times, there are 2 rules: > 1. shared inhibits read and write access to

Shared - Another Thread

2018-10-17 Thread Stefan Koch via Digitalmars-d
Hi, reading the other shared thread "shared - i need to be useful"(https://forum.dlang.org/thread/mailman.4299.1539629222.29801.digitalmar...@puremagic.com) let me to an important realisation concerning the reason shareding data across threads is so unintuitve and hard to get right. The

Re: Can Scope Be Used for Anonymous Objects?

2018-10-17 Thread Stanislav Blinov via Digitalmars-d-learn
On Wednesday, 17 October 2018 at 20:53:02 UTC, Vijay Nayar wrote: This particular use of "scope" I overheard at the last DConf, and I believe it has been added to the official documentation here: https://dlang.org/spec/expression.html#new_expressions If a NewExpression is used as an

Re: Shared - Another Thread

2018-10-17 Thread Stanislav Blinov via Digitalmars-d
On Wednesday, 17 October 2018 at 21:29:07 UTC, Stefan Koch wrote: in any case it would certainly mess up the state of everyone involved; which is exactly what happens win multi-threaded situations. ^ that is very true. And that is why: - one must not keep shared and local data close

Re: Shared - Another Thread

2018-10-17 Thread H. S. Teoh via Digitalmars-d
On Wed, Oct 17, 2018 at 10:13:37PM +, Stefan Koch via Digitalmars-d wrote: > On Wednesday, 17 October 2018 at 21:55:48 UTC, H. S. Teoh wrote: [...] > > But nobody will be building a fusion engine out of race conditions > > anytime in the foreseeable future. :-D [...] > Now my analogy sounds

Re: shared - i need it to be useful

2018-10-17 Thread Manu via Digitalmars-d
On Wed, Oct 17, 2018 at 2:15 PM Stanislav Blinov via Digitalmars-d wrote: > > On Wednesday, 17 October 2018 at 19:25:33 UTC, Manu wrote: > > On Wed, Oct 17, 2018 at 12:05 PM Stanislav Blinov via > > Digitalmars-d wrote: > >> > >> On Wednesday, 17 October 2018 at 18:46:18 UTC, Manu wrote: > >> >

Re: My statements related to terminating my SAoC relationship

2018-10-17 Thread solidstate1991 via Digitalmars-d
On Tuesday, 16 October 2018 at 02:20:09 UTC, Soulsbane wrote: Have you tried melatonin? My doctor has me take a 1mg tablet and split it in two. So I take 1/2 at bedtime. That is the sweet spot. If you take more than that you will end up groggy. No, but I'll since I used to have this issue

Re: shared - i need it to be useful

2018-10-17 Thread Erik van Velzen via Digitalmars-d
I don't have anything to add that hasn't been said yet but it's good to see some thinking on this subject. It feels like progress.

Re: shared - i need it to be useful

2018-10-17 Thread Manu via Digitalmars-d
On Wed, Oct 17, 2018 at 5:35 PM Stanislav Blinov via Digitalmars-d wrote: > > On Wednesday, 17 October 2018 at 23:12:48 UTC, Manu wrote: > > On Wed, Oct 17, 2018 at 2:15 PM Stanislav Blinov via > > Digitalmars-d wrote: > >> > >> On Wednesday, 17 October 2018 at 19:25:33 UTC, Manu wrote: > >> >

Re: Do D's std.signals check for already-connected slot and simply ignore the call?

2018-10-17 Thread Enjoys Math via Digitalmars-d-learn
Answer: they don't connect uniquely, you have to manage that yourself.

Re: Shared - Another Thread

2018-10-17 Thread Stefan Koch via Digitalmars-d
On Wednesday, 17 October 2018 at 22:56:26 UTC, H. S. Teoh wrote: On Wed, Oct 17, 2018 at 10:13:37PM +, Stefan Koch via Digitalmars-d wrote: On Wednesday, 17 October 2018 at 21:55:48 UTC, H. S. Teoh wrote: [...] > But nobody will be building a fusion engine out of race > conditions anytime

Re: lazy variables

2018-10-17 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 17 October 2018 at 07:32:37 UTC, aliak wrote: lazy S x = () { // do some heavy stuff }(); if (condition) { func(x.y); // heavy stuff evaluated here } auto x = () { // do some heavy stuff }; if (condition) { func(x().y); // heavy stuff evaluated here } If you want

Re: Access program args outside of main

2018-10-17 Thread Jordan Wilson via Digitalmars-d-learn
On Wednesday, 17 October 2018 at 22:37:53 UTC, Stanislav Blinov wrote: On Wednesday, 17 October 2018 at 22:30:31 UTC, Jordan Wilson wrote: Ideally, I'd check args before I take the time to load up data. https://dlang.org/phobos/core_runtime.html#.Runtime Here I was looking through

Re: shared - i need it to be useful

2018-10-17 Thread Stanislav Blinov via Digitalmars-d
On Wednesday, 17 October 2018 at 23:12:48 UTC, Manu wrote: On Wed, Oct 17, 2018 at 2:15 PM Stanislav Blinov via Digitalmars-d wrote: On Wednesday, 17 October 2018 at 19:25:33 UTC, Manu wrote: > On Wed, Oct 17, 2018 at 12:05 PM Stanislav Blinov via > Digitalmars-d wrote: >> >> On Wednesday,

Re: shared - i need it to be useful

2018-10-17 Thread Steven Schveighoffer via Digitalmars-d
On 10/17/18 6:37 PM, Manu wrote: On Wed, Oct 17, 2018 at 12:35 PM Steven Schveighoffer via Digitalmars-d wrote: On 10/17/18 2:46 PM, Manu wrote: On Wed, Oct 17, 2018 at 10:30 AM Steven Schveighoffer via What the example demonstrates is that while you are trying to disallow implicit

Re: shared - i need it to be useful

2018-10-17 Thread Stanislav Blinov via Digitalmars-d
On Wednesday, 17 October 2018 at 18:46:18 UTC, Manu wrote: I've said this a bunch of times, there are 2 rules: 1. shared inhibits read and write access to members 2. `shared` methods must be threadsafe From there, shared becomes interesting and useful. Oh God... void atomicInc(shared int*

Re: shared - i need it to be useful

2018-10-17 Thread NX via Digitalmars-d
I don't see any problem with this proposal as long as these points hold: - Shared <-> Unshared is never implicit, either requiring an explicit cast (both ways) or having a language support which allows the conversion gracefully. - Shared methods are called by compiler if the type is shared or

Re: Shared - Another Thread

2018-10-17 Thread Stefan Koch via Digitalmars-d
On Wednesday, 17 October 2018 at 21:12:49 UTC, Stefan Koch wrote: [another person] cannot actually occupy the same space. It is physically impossible. Actually, that's not quite true, If they were to try hard enough the result would be nuclear fusion, (I am guessing (I am not a phsysist)),

Re: Shared - Another Thread

2018-10-17 Thread H. S. Teoh via Digitalmars-d
On Wed, Oct 17, 2018 at 09:29:07PM +, Stefan Koch via Digitalmars-d wrote: > On Wednesday, 17 October 2018 at 21:12:49 UTC, Stefan Koch wrote: > > [another person] cannot actually occupy the same space. It is > > physically impossible. > > Actually, that's not quite true, If they were to try

Re: Shared - Another Thread

2018-10-17 Thread Stanislav Blinov via Digitalmars-d
On Wednesday, 17 October 2018 at 21:55:48 UTC, H. S. Teoh wrote: But nobody will be building a fusion engine out of race conditions anytime in the foreseeable future. :-D We should be so blessed...

Access program args outside of main

2018-10-17 Thread Jordan Wilson via Digitalmars-d-learn
Hello, Is there a way to access command line arguments outside of main? // main.d module main; import data; void main(string args[]) { } // data.d module data immutable programData; static this() { // read in data } Ideally, I'd check args before I take the time to load up data.

Re: Access program args outside of main

2018-10-17 Thread Stanislav Blinov via Digitalmars-d-learn
On Wednesday, 17 October 2018 at 22:30:31 UTC, Jordan Wilson wrote: Ideally, I'd check args before I take the time to load up data. https://dlang.org/phobos/core_runtime.html#.Runtime

Re: Which Docker to use?

2018-10-17 Thread Jon Degenhardt via Digitalmars-d-learn
On Wednesday, 17 October 2018 at 08:08:44 UTC, Gary Willoughby wrote: On Wednesday, 17 October 2018 at 03:37:21 UTC, Ky-Anh Huynh wrote: Hi, I need to build some static binaries with LDC. I also need to execute builds on both platform 32-bit and 64-bit. From Docker Hub there are two image

How do you get a .dub project to build / run / debug in Visual D?

2018-10-17 Thread Enjoys Math via Digitalmars-d-learn
I'm referring mainly to the `dagon` game engine. Doing: dub build :tutorial1 dub run :tutorial1 works on windows 10. I'm not sure how to replicate this build process with Visual Studio 2017 project settings. Dagon is building, but I'm getting errors with a basic Hellow World app in Dagon.

Re: Beta 2.082.0

2018-10-17 Thread Jesse Phillips via Digitalmars-d-announce
On Wednesday, 17 October 2018 at 16:14:14 UTC, Neia Neutuladh wrote: On Wednesday, 17 October 2018 at 14:02:20 UTC, Jesse Phillips wrote: Wait, why does each get a special bailout? Doesn't until full that role? `until` is lazy. We could have `doUntil` instead, which would be eager and would

Re: My statements related to terminating my SAoC relationship

2018-10-17 Thread lagfra via Digitalmars-d
On Monday, 15 October 2018 at 21:26:52 UTC, solidstate1991 wrote: I have done two mistakes: I underestimated the scope of the project and overestimated my capabilities. This caused a chain reaction, which in turn made the first milestone unreachable. Hi, I'm one of the other participants to

Re: Can Scope Be Used for Anonymous Objects?

2018-10-17 Thread Ali Çehreli via Digitalmars-d-learn
On 10/17/2018 01:24 PM, Vijay Nayar wrote: I have a snippet of code like this:     scope chordAngle = new S1ChordAngle(_center, other._center);     return _radius + other._radius >= chordAngle; The reason the "scope" temporary variable exists is to avoid a heap allocation and instead prefer

Re: shared - i need it to be useful

2018-10-17 Thread ag0aep6g via Digitalmars-d
On 17.10.18 20:46, Manu wrote: struct NotThreadsafe { int x; void local() { ++x; // <- invalidates the method below, you violate the other function's `shared` promise } void notThreadsafe() shared { atomicIncrement(); } } In the `shared` method you'd get a nice

Re: Spasm - webassembly libary for single page applications

2018-10-17 Thread aberba via Digitalmars-d-announce
On Sunday, 14 October 2018 at 19:04:51 UTC, Sebastiaan Koppe wrote: On Sunday, 14 October 2018 at 06:03:10 UTC, Bogdan wrote: Awesome work! I remember that, at some point the https://glimmerjs.com/ authors wanted to write their vm in rust for better performance. It looks like D is a new option

Re: Can Scope Be Used for Anonymous Objects?

2018-10-17 Thread Vijay Nayar via Digitalmars-d-learn
On Wednesday, 17 October 2018 at 20:41:24 UTC, Ali Çehreli wrote: On 10/17/2018 01:24 PM, Vijay Nayar wrote: I have a snippet of code like this:     scope chordAngle = new S1ChordAngle(_center, other._center);     return _radius + other._radius >= chordAngle; The reason the "scope"

Re: Can Scope Be Used for Anonymous Objects?

2018-10-17 Thread Vijay Nayar via Digitalmars-d-learn
On Wednesday, 17 October 2018 at 20:51:29 UTC, Stanislav Blinov wrote: On Wednesday, 17 October 2018 at 20:24:56 UTC, Vijay Nayar wrote: I have a snippet of code like this: scope chordAngle = new S1ChordAngle(_center, other._center); return _radius + other._radius >= chordAngle; The

Re: Can Scope Be Used for Anonymous Objects?

2018-10-17 Thread Stanislav Blinov via Digitalmars-d-learn
On Wednesday, 17 October 2018 at 20:24:56 UTC, Vijay Nayar wrote: I have a snippet of code like this: scope chordAngle = new S1ChordAngle(_center, other._center); return _radius + other._radius >= chordAngle; The reason the "scope" temporary variable exists is to avoid a heap

Re: custom sorting of lists ?

2018-10-17 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/17/18 2:03 PM, Carl Sturtivant wrote: On Monday, 15 October 2018 at 13:39:59 UTC, Steven Schveighoffer wrote: But that's just the thing -- merge sort *does* depend on the container type. It requires the ability to rearrange the elements structurally, since you merge the sets of items

Re: lazy variables

2018-10-17 Thread Ali Çehreli via Digitalmars-d-learn
On 10/17/2018 12:32 AM, aliak wrote: Hi, Is there any notion of lazy vars in D (i see that there're parameters)? i.e: struct S {   //...   int y;   //... } lazy S x = () {     // do some heavy stuff }(); if (condition) {   func(x.y); // heavy stuff evaluated here } Cheers, - Ali

Can Scope Be Used for Anonymous Objects?

2018-10-17 Thread Vijay Nayar via Digitalmars-d-learn
I have a snippet of code like this: scope chordAngle = new S1ChordAngle(_center, other._center); return _radius + other._radius >= chordAngle; The reason the "scope" temporary variable exists is to avoid a heap allocation and instead prefer a value be created on the stack. Is there a

Re: Can Scope Be Used for Anonymous Objects?

2018-10-17 Thread Ali Çehreli via Digitalmars-d-learn
On 10/17/2018 01:53 PM, Vijay Nayar wrote: > https://dlang.org/spec/expression.html#new_expressions > > If a NewExpression is used as an initializer for a function local > variable with > scope storage class, and the ArgumentList to new is empty, then the > instance is > allocated

Re: Shared - Another Thread

2018-10-17 Thread Stefan Koch via Digitalmars-d
On Wednesday, 17 October 2018 at 21:40:35 UTC, Stanislav Blinov wrote: Now, I perfectly understand what Manu wants: for `shared` to stop being a stupid keyword that nobody uses, and start bringing in value to the language. At the moment, the compiler happily allows you to write and read

Re: shared - i need it to be useful

2018-10-17 Thread Steven Schveighoffer via Digitalmars-d
On 10/17/18 2:46 PM, Manu wrote: On Wed, Oct 17, 2018 at 10:30 AM Steven Schveighoffer via What the example demonstrates is that while you are trying to disallow implicit casting of a shared pointer to an unshared pointer, you have inadvertently allowed it by leaving behind an unshared

Re: Shared - Another Thread

2018-10-17 Thread Stefan Koch via Digitalmars-d
On Wednesday, 17 October 2018 at 21:55:48 UTC, H. S. Teoh wrote: Nah, that's not even anywhere close to nuclear fusion. The atoms which make up your body (and basically everything else) are mostly empty, with just a tiny speck of a nucleus, and a bunch of extremely tiny electrons zipping

lazy variables

2018-10-17 Thread aliak via Digitalmars-d-learn
Hi, Is there any notion of lazy vars in D (i see that there're parameters)? i.e: struct S { //... int y; //... } lazy S x = () { // do some heavy stuff }(); if (condition) { func(x.y); // heavy stuff evaluated here } Cheers, - Ali

Re: Norwich 2018-11-07

2018-10-17 Thread Russel Winder via Digitalmars-d
A PS to the bit on D vs Rust: The Rust plugin to CLion is managed by JetBrains and has resource assigned, the D plugin to CLion is a pure volunteer effort. The Rust development experience in CLion is really rather good. The D development experience in CLion is there, but clearly a WIP. I mention

std.digest

2018-10-17 Thread Márcio Martins via Digitalmars-d
Hi! To my surprise, std.digest.MurmurHash3 doesn't work in CTFE. Would it be hard to have it explicit in the documentation if a particular Phobos symbol works in CTFE? Maybe it could be manual, and vote-based, to avoid building infrastructure around it. Also, MurmurHash3 only outputs 32-bit

Re: std.digest

2018-10-17 Thread rikki cattermole via Digitalmars-d
On 17/10/2018 10:36 PM, Márcio Martins wrote: Hi! To my surprise, std.digest.MurmurHash3 doesn't work in CTFE. Would it be hard to have it explicit in the documentation if a particular Phobos symbol works in CTFE? Maybe it could be manual, and vote-based, to avoid building infrastructure

Re: Dealing with ranges where front and popFront do the same logic / eager ranges

2018-10-17 Thread Dukc via Digitalmars-d-learn
On Tuesday, 16 October 2018 at 22:59:50 UTC, Dennis wrote: [snip] The first thing to consider for invalid tokens, at least for me, would be to either have popFront set empty to true, or set front to some value representing a parsing error. A programming language parser almost certainly

Re: My statements related to terminating my SAoC relationship

2018-10-17 Thread welkam via Digitalmars-d
On Monday, 15 October 2018 at 21:26:52 UTC, solidstate1991 wrote: my sleep disorder became even worse. I started to sleep 10-12 hours a day while spending around 4-6 hours in bed just to trying to fall asleep And when you wake up do you feel rested and fully awake or does it take time to

Re: shared - i need it to be useful

2018-10-17 Thread Stanislav Blinov via Digitalmars-d
On Wednesday, 17 October 2018 at 05:40:41 UTC, Walter Bright wrote: When Andrei and I came up with the rules for: mutable const shared const shared immutable and which can be implicitly converted to what, so far nobody has found a fault in those rules... Here's one: shared

[Issue 19309] [Reg 2.080.0] Unicode char reference in a comment causes warning

2018-10-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19309 --- Comment #1 from Ludovit Lucenic --- This is the code excerpt (comment): /** * Grammar: * source code characters are defined by the following grammar rules * --- *Character ::= LineCharacter | EndOfLineCharacter * *LineCharacter ::=

Re: shared - i need it to be useful

2018-10-17 Thread Manu via Digitalmars-d
On Tue, Oct 16, 2018 at 10:45 PM Walter Bright via Digitalmars-d wrote: > > On 10/15/2018 11:46 AM, Manu wrote: > > [...] > > Shared has one incredibly valuable feature - it allows you, the programmer, to > identify data that can be accessed by multiple threads. There are so many ways > that data

Re: how to get UDA only for methods

2018-10-17 Thread Stanislav Blinov via Digitalmars-d-learn
On Wednesday, 17 October 2018 at 02:54:26 UTC, test wrote: I need get the Route UDA only for method without (static methods, property, constructor, destructor), dont know how to do it. 1) Note that __traits(allMembers, T) gets you a tuple of names, not actual member aliases. 2) Remember

Re: Which Docker to use?

2018-10-17 Thread Gary Willoughby via Digitalmars-d-learn
On Wednesday, 17 October 2018 at 03:37:21 UTC, Ky-Anh Huynh wrote: Hi, I need to build some static binaries with LDC. I also need to execute builds on both platform 32-bit and 64-bit. From Docker Hub there are two image groups: * language/ldc (last update 5 months ago) * dlang2/ldc-ubuntu

Re: Norwich 2018-11-07

2018-10-17 Thread Russel Winder via Digitalmars-d
On Tue, 2018-10-16 at 16:31 +, Gerald via Digitalmars-d wrote: […] > Wish I could see this one, it would be very interesting to hear > your thoughts on C++ vs D vs Rust in terms of working with GTK. I do not know if the sessions are recorded. C++ and gtkmm sort of work but using C++ always

betterC generate dynamic array throw Error: TypeInfo cannot be used with -betterC

2018-10-17 Thread test via Digitalmars-d-learn
test1: module test1; import test2; enum X = getR(1,3); void main(string[] args){} test2: module test2; struct R { int i; } R[] getR(int a, int b){ R[] r; r ~= R(a); r ~= R(b); return r; } to build

Re: betterC generate dynamic array throw Error: TypeInfo cannot be used with -betterC

2018-10-17 Thread test via Digitalmars-d-learn
On Wednesday, 17 October 2018 at 07:01:21 UTC, test wrote: test2.d(3): Error: TypeInfo cannot be used with -betterC the first problem is the error message is not clear and can be improved. And my question is how to workaround this to make it work with betterC.

Re: lazy variables

2018-10-17 Thread Chris Katko via Digitalmars-d-learn
On Wednesday, 17 October 2018 at 07:32:37 UTC, aliak wrote: Hi, Is there any notion of lazy vars in D (i see that there're parameters)? i.e: struct S { //... int y; //... } lazy S x = () { // do some heavy stuff }(); if (condition) { func(x.y); // heavy stuff evaluated here }

Re: shared - i need it to be useful

2018-10-17 Thread Manu via Digitalmars-d
On Wed, Oct 17, 2018 at 12:35 PM Steven Schveighoffer via Digitalmars-d wrote: > > On 10/17/18 2:46 PM, Manu wrote: > > On Wed, Oct 17, 2018 at 10:30 AM Steven Schveighoffer via > > >> What the example demonstrates is that while you are trying to disallow > >> implicit casting of a shared pointer

Re: betterC generate dynamic array throw Error: TypeInfo cannot be used with -betterC

2018-10-17 Thread learnfirst1 via Digitalmars-d-learn
On Wednesday, 17 October 2018 at 16:50:36 UTC, Paul Backus wrote: You can't append to an array in betterC code, because making space for the new elements requires allocating memory, and that uses the GC. In theory, since you're only using the GC during CTFE, it shouldn't be a problem, but

Re: DMD Linker Issue on Windows

2018-10-17 Thread Kai via Digitalmars-d
On Wednesday, 17 October 2018 at 17:44:34 UTC, Adam D. Ruppe wrote: On Wednesday, 17 October 2018 at 17:37:37 UTC, Kai wrote: I just ran into this linker issue (see answer below that I grabbed from the vibe.d forum) as well - where can I ask/track about the progress on this issue? Do you

[Issue 11482] Add `alias this` support for `null` class instances

2018-10-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11482 RazvanN changed: What|Removed |Added Status|NEW |RESOLVED CC|

Re: shared - i need it to be useful

2018-10-17 Thread Timon Gehr via Digitalmars-d
On 15.10.2018 23:51, Manu wrote: If a shared method is incompatible with an unshared method, your class is broken. Then what you want is not implicit unshared->shared conversion. What you want is a different way to type shared member access. You want a setup where shared methods are only

Re: shared - i need it to be useful

2018-10-17 Thread jmh530 via Digitalmars-d
On Wednesday, 17 October 2018 at 05:40:41 UTC, Walter Bright wrote: On 10/15/2018 11:46 AM, Manu wrote: [...] Shared has one incredibly valuable feature - it allows you, the programmer, to identify data that can be accessed by multiple threads. There are so many ways that data can be

Re: shared - i need it to be useful

2018-10-17 Thread Timon Gehr via Digitalmars-d
On 16.10.2018 19:25, Manu wrote: On Tue, Oct 16, 2018 at 3:20 AM Timon Gehr via Digitalmars-d wrote: On 15.10.2018 20:46, Manu wrote: Assuming the rules above: "can't read or write to members", and the understanding that `shared` methods are expected to have threadsafe implementations

2019 H1 Vision document?

2018-10-17 Thread JN via Digitalmars-d
Looks like 2018H2 vision hasn't been published, and it's a bit late for it. Are there any plans for 2019H1 document? I think it provides a good framework for discussions, gives something to get excited about. Right now it's hard to see what are the short and long term goals for the language

Re: shared - i need it to be useful

2018-10-17 Thread jmh530 via Digitalmars-d
On Wednesday, 17 October 2018 at 07:20:20 UTC, Manu wrote: [snip] Oh bollocks... everyone has been complaining about this for at least the 10 years I've been here! [snip] As far as I had known from reading the forums, shared was not feature complete. Also, are you familiar with Atila's

Re: shared - i need it to be useful

2018-10-17 Thread Timon Gehr via Digitalmars-d
On 16.10.2018 20:07, Manu wrote: On Tue, Oct 16, 2018 at 6:25 AM Timon Gehr via Digitalmars-d wrote: On 16.10.2018 13:04, Dominikus Dittes Scherkl wrote: On Tuesday, 16 October 2018 at 10:15:51 UTC, Timon Gehr wrote: On 15.10.2018 20:46, Manu wrote: Assuming the rules above: "can't read

Re: Dealing with ranges where front and popFront do the same logic / eager ranges

2018-10-17 Thread Stanislav Blinov via Digitalmars-d-learn
On Wednesday, 17 October 2018 at 09:53:22 UTC, Dukc wrote: Whatever iterates through the range could then throw an appopriate exception when it encounters an error token. Exceptions in a parser? Monsieur knows his perversion.

  1   2   >