Re: what is the mean that call function start with a dot.

2019-09-21 Thread Paul Backus via Digitalmars-d-learn
On Sunday, 22 September 2019 at 04:15:53 UTC, lili wrote: Hi: yesterday I saw some d code, where is an .fn() call syntax, what is it mean. It means that `fn` is looked up in the module's top-level scope. Source: https://dlang.org/spec/expression.html#identifier

what is the mean that call function start with a dot.

2019-09-21 Thread lili via Digitalmars-d-learn
Hi: yesterday I saw some d code, where is an .fn() call syntax, what is it mean.

Re: Looking for a Simple Doubly Linked List Implementation

2019-09-21 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, September 21, 2019 12:52:23 PM MDT Dennis via Digitalmars-d- learn wrote: > Since I marked the method as const, `auto a = head` got the type > const(Node!T) and `a = a.next` no longer compiled. With structs > you can declare a const(Node!T)* (mutable pointer to const node), > but I

Re: Looking for a Simple Doubly Linked List Implementation

2019-09-21 Thread Ron Tarrant via Digitalmars-d-learn
Sorry. I posted the wrong file. This is the one that works: ``` import std.stdio; import std.conv; class TabList { private: Tab _head; int _lastUniqueID = 0; string labelText; this() { append(); }

Re: Looking for a Simple Doubly Linked List Implementation

2019-09-21 Thread Ron Tarrant via Digitalmars-d-learn
On Saturday, 21 September 2019 at 18:52:23 UTC, Dennis wrote: On Saturday, 21 September 2019 at 08:34:09 UTC, Ron Tarrant wrote: Thanks, Dennis. Not performant... It doesn't work? I was hoping for a complete, working example, but maybe this'll help. Bad word choice (it appears it's debatable

Re: Looking for a Simple Doubly Linked List Implementation

2019-09-21 Thread Dennis via Digitalmars-d-learn
On Saturday, 21 September 2019 at 08:34:09 UTC, Ron Tarrant wrote: Thanks, Dennis. Not performant... It doesn't work? I was hoping for a complete, working example, but maybe this'll help. Bad word choice (it appears it's debatable whether 'performant' even is a word), I meant it was a simple

Re: Looking for a Simple Doubly Linked List Implementation

2019-09-21 Thread Ron Tarrant via Digitalmars-d-learn
Thanks for all the responses, y'all. I got it figured out thanks to ag0aep6g pointing out something I forgot about the nature of class objects in D (Damn my failing memory). The results will show up on the gtkDcoding blog sometime in (I'm guessing) November as part of the the Notebook

Re: initialize float4 (core.simd)

2019-09-21 Thread Stefan Koch via Digitalmars-d-learn
On Saturday, 21 September 2019 at 13:42:09 UTC, Bogdan wrote: Well, this seems to be working: float[4] doSimd(float[4] values, float delta) { float4 v_delta = delta; float4 v_values = __simd(XMM.ADDPS, __simd(XMM.LODAPS, values[0]),

Re: initialize float4 (core.simd)

2019-09-21 Thread Bogdan via Digitalmars-d-learn
Well, this seems to be working: float[4] doSimd(float[4] values, float delta) { float4 v_delta = delta; float4 v_values = __simd(XMM.ADDPS, __simd(XMM.LODAPS, values[0]), v_delta); return [v_values[0],

Re: initialize float4 (core.simd)

2019-09-21 Thread Bogdan via Digitalmars-d-learn
Here's a cleaned up version: ``` import std.stdio; import core.simd; void main() { float[4] values = [1.0f, 2.0f, 3.0f, 4.0f]; float delta = 15.0f; writeln(doSimd(values, delta)); } float[4] doSimd(float[4] values, float delta) { float4 v_delta = delta; float4 v_values = values;

initialize float4 (core.simd)

2019-09-21 Thread Bogdan via Digitalmars-d-learn
I'm trying to understand how to use the `core.simd` functionality, and I'm having trouble initializing a float4 vector. Here's my example code: ``` import std.stdio; import core.simd; void main() { float[4] values = [1.0f, 2.0f, 3.0f, 4.0f]; float delta = 15.0f; writeln(doSimd(values,

Re: Looking for a Simple Doubly Linked List Implementation

2019-09-21 Thread Alex via Digitalmars-d-learn
On Friday, 20 September 2019 at 20:26:03 UTC, Ron Tarrant wrote: Hi guys, I've been banging my head on the screen with this one for the last week or so. For whatever reason, I'm having major problems understanding how to implement a doubly-linked list in D. I don't know if it's because I'm

Re: Looking for a Simple Doubly Linked List Implementation

2019-09-21 Thread Tobias Pankrath via Digitalmars-d-learn
On Saturday, 21 September 2019 at 09:03:13 UTC, Ron Tarrant wrote: Ah! Thanks, ag0aep6g. I was wondering about that when I was writing the code. (If I already knew this, I'd forgotten.) I did as you suggested, took out all '*' and '&' and it works perfectly. Is this what you want? ---

dub with sub packages: sub package with targetType "executable" builds with configuration ""

2019-09-21 Thread Tobias Pankrath via Digitalmars-d-learn
Hi, I've got a dub package with the following configuration file --- { "description": "A minimal D application.", "license": "proprietary", "authors": [ "me" ], "copyright": "Copyright © 2019, me", "name": "test", "targetType" : "none", "dependencies": {

Re: Looking for a Simple Doubly Linked List Implementation

2019-09-21 Thread Ron Tarrant via Digitalmars-d-learn
On Saturday, 21 September 2019 at 08:49:48 UTC, ag0aep6g wrote: On 21.09.19 10:34, Ron Tarrant wrote: Here's a question for the room: Does a doubly-linked list always have to be done with structs? Can it be classes instead? (Maybe that's why I can't get it to work, because I've been trying

Re: Looking for a Simple Doubly Linked List Implementation

2019-09-21 Thread ag0aep6g via Digitalmars-d-learn
On 21.09.19 10:34, Ron Tarrant wrote: Here's a question for the room: Does a doubly-linked list always have to be done with structs? Can it be classes instead? (Maybe that's why I can't get it to work, because I've been trying to make an OOP version?) It can be done with classes. When I

Re: Looking for a Simple Doubly Linked List Implementation

2019-09-21 Thread Ron Tarrant via Digitalmars-d-learn
On Friday, 20 September 2019 at 20:35:41 UTC, H. S. Teoh wrote: Not a minimal example by any means, but Phobos *does* come with a doubly-linked list implementation: std.container.dlist. Thanks, H.S. I did come across that in my search. Trouble is, with all the extra stuff in there, I'm

Re: Why must a bidirectional range also be a forward range?

2019-09-21 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, September 20, 2019 7:08:03 AM MDT Joseph Rushton Wakeling via Digitalmars-d-learn wrote: > On Thursday, 19 September 2019 at 22:55:55 UTC, Jonathan M Davis > > wrote: > > For better or worse, ranges were more or less set up as a > > linear hierarchy, and it's unlikely that use cases