Re: Can I rely on format returned by fullyQualifiedName?

2021-04-23 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 24 April 2021 at 03:40:20 UTC, Jack wrote: Can I rely on this format from fullyQualifiedName? for example, let's say I do: ```d enum s = fullyQualifiedName!f.split; ``` where f is a function member of a class. Can I realy that s[0] is the module name, s[1] is the class name and

Can I rely on format returned by fullyQualifiedName?

2021-04-23 Thread Jack via Digitalmars-d-learn
Can I rely on this format from fullyQualifiedName? for example, let's say I do: ```d enum s = fullyQualifiedName!f.split; ``` where f is a function member of a class. Can I realy that s[0] is the module name, s[1] is the class name and s[2] the functio name? is this standard or can the

Re: When should I use SortedRange.release?

2021-04-23 Thread Bastiaan Veelo via Digitalmars-d-learn
On Friday, 23 April 2021 at 21:34:39 UTC, Steven Schveighoffer wrote: `SortedRange` itself is kind of a kludge of "policy" that isn't fit for function. I use release to get the original data type out (via r.save.release), but that's about it. See my rant about it

Re: When should I use SortedRange.release?

2021-04-23 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/23/21 1:35 PM, Bastiaan Veelo wrote: For reference, `SortedRange.release` is [documented](https://dlang.org/phobos/std_range.html#.SortedRange) as such: "Releases the controlled range and returns it." Wow thanks! I love functions that are named exactly as what they do ;-) Seriously

Re: When should I use SortedRange.release?

2021-04-23 Thread Bastiaan Veelo via Digitalmars-d-learn
On Friday, 23 April 2021 at 18:35:25 UTC, Paul Backus wrote: On Friday, 23 April 2021 at 17:35:13 UTC, Bastiaan Veelo wrote: What happens when a range is released? What happens if a range is not released? What happens if a range is released more than once? And what does "controlled" imply

Re: When should I use SortedRange.release?

2021-04-23 Thread Paul Backus via Digitalmars-d-learn
On Friday, 23 April 2021 at 17:35:13 UTC, Bastiaan Veelo wrote: What happens when a range is released? What happens if a range is not released? What happens if a range is released more than once? And what does "controlled" imply here? In what way has `SortedRange` control over the underlaying

When should I use SortedRange.release?

2021-04-23 Thread Bastiaan Veelo via Digitalmars-d-learn
For reference, `SortedRange.release` is [documented](https://dlang.org/phobos/std_range.html#.SortedRange) as such: "Releases the controlled range and returns it." Wow thanks! I love functions that are named exactly as what they do ;-) Seriously though, I still don't know what it is that it

Re: dlang opengl / gl / glu /glut library.

2021-04-23 Thread Alain De Vos via Digitalmars-d-learn
If i'm correct, sdl gives you a window opengl allows to draw in this window dlang allows to model the world with objects. "Needing a hello world :)"

Re: Iteratable single linked list of floats.

2021-04-23 Thread Alain De Vos via Digitalmars-d-learn
Here a working code, ``` import std.stdio; void main(){ struct List { struct Node { float f; Node *next=null; } Node * root=null; bool empty() const {return !root;} void popFront() {root=root.next;} float front()

Re: CTFE Assignment to anonymous union shows unexpected behavior

2021-04-23 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/22/21 6:47 PM, Rekel wrote: I'm not sure why this is happening, but after simplifying my code I traced it back to what the title may suggest. The original cause of my issues being summarized by debug print statements returning a union as: Mat([nanf, nanF, . . . .], [[1.0F, 0.0F, . . . .])

Re: CTFE Assignment to anonymous union shows unexpected behavior

2021-04-23 Thread Imperatorn via Digitalmars-d-learn
On Friday, 23 April 2021 at 10:36:40 UTC, Imperatorn wrote: On Thursday, 22 April 2021 at 22:47:17 UTC, Rekel wrote: I'm not sure why this is happening, but after simplifying my code I traced it back to what the title may suggest. The original cause of my issues being summarized by debug print

Re: CTFE Assignment to anonymous union shows unexpected behavior

2021-04-23 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 22 April 2021 at 22:47:17 UTC, Rekel wrote: I'm not sure why this is happening, but after simplifying my code I traced it back to what the title may suggest. The original cause of my issues being summarized by debug print statements returning a union as: [...] Even though the

Re: CTFE Assignment to anonymous union shows unexpected behavior

2021-04-23 Thread Rekel via Digitalmars-d-learn
On Friday, 23 April 2021 at 00:55:50 UTC, H. S. Teoh wrote: [...] If you read the field during CTFE. I've never tested initializing a union in CTFE then reading it at runtime, though. Not sure exactly what would happen in that case. T I'm not referring to reading non-initial variables,

Re: String concatenation segmentation error

2021-04-23 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 22 April 2021 at 21:15:48 UTC, tcak wrote: string fileContent = ""; ... [...] Do you have a minimal reproducible test case? 樂