For fun, and executable lame joke

2021-05-30 Thread btiffin via Digitalmars-d-learn
Here's the short version `["hip", "hip"]` the hip hip array (or hooray as suits the lame joke). Here's some executable code ```d void array(string[] a) { import std.stdio : writeln; foreach(t; a) writeln(t); } void main() { D(); } void D() { ["hip", "hip"].array; } ``` Is there a

Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-30 Thread btiffin via Digitalmars-d-learn
On Thursday, 27 May 2021 at 01:17:44 UTC, someone wrote: Any comments are welcomed, even any comments regarding anyone experience with GUI development within D, no matter whether the answer would be relevant to my specific question seeking a choice or not. Along that tack, and as an

Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-30 Thread dangbinghoo via Digitalmars-d-learn
On Sunday, 30 May 2021 at 12:27:34 UTC, Siemargl wrote: On Thursday, 27 May 2021 at 01:17:44 UTC, someone wrote: Yes, I know this is a question lacking a straightforward answer. Requirements: - desktop only: forget about support for mobile tablets whatever You forget semi-official DWT

Re: Naming issue importing different function overloads

2021-05-30 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 30 May 2021 at 18:42:34 UTC, data pulverizer wrote: I wonder if it is a purposeful design It is by design: https://dlang.org/articles/hijack.html Basically the idea behind it is to make sure that a change in a lib you import doesn't change your existing code without you realizing

Naming issue importing different function overloads

2021-05-30 Thread data pulverizer via Digitalmars-d-learn
Hi, There's issue in importing functions I came across some time ago that I wonder if it is a purposeful design or if it is something that will be changed in the future. Say I have module like this: ```d module funs; double myfun(double x) { return x*x; } ``` and I call `myfun` in a

Offtopic: A tune for vibers, maybe

2021-05-30 Thread btiffin via Digitalmars-d-learn
21 Pilots, Outside https://www.youtube.com/watch?v=m2w6GkV3U6Q On note, "Kids'll try to take my vibes. Or am I on the outside?" Outro: "Little did they know, they can't touch me. I'm VIBIN', VIBIN'." Have good, make well, Blue

Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-30 Thread zjh via Digitalmars-d-learn
On Thursday, 27 May 2021 at 07:20:17 UTC, zjh wrote: On maybe try Gacui.

Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-30 Thread Siemargl via Digitalmars-d-learn
On Thursday, 27 May 2021 at 01:17:44 UTC, someone wrote: Yes, I know this is a question lacking a straightforward answer. Requirements: - desktop only: forget about support for mobile tablets whatever You forget semi-official DWT https://forum.dlang.org/group/dwt

Re: Is there a nicer way to get the first element or typeof(element).init from a range?

2021-05-30 Thread realhet via Digitalmars-d-learn
On Sunday, 30 May 2021 at 12:16:19 UTC, realhet wrote: presets.keys.sort.take(1).get(0); <- Oups: after fixing an error and making it compile the solution is even uglier: presets.keys.sort.take(1).array.get(0);

Is there a nicer way to get the first element or typeof(element).init from a range?

2021-05-30 Thread realhet via Digitalmars-d-learn
Hello, This is my current solution but there must be a better way to do it in D T get(T)(T[] arr, size_t idx, T def = T.init){ return idx

Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-30 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Sunday, 30 May 2021 at 12:09:22 UTC, cc wrote: This is overkill for any reasonable application, but I've always wanted to design a whole UI framework in OpenGL, just for the novelty of it. I always end up having to reinvent the wheel for UI elements in my projects anyway.

Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-30 Thread cc via Digitalmars-d-learn
This is overkill for any reasonable application, but I've always wanted to design a whole UI framework in OpenGL, just for the novelty of it. I always end up having to reinvent the wheel for UI elements in my projects anyway. https://streamable.com/2uvt4h

Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-30 Thread Imperatorn via Digitalmars-d-learn
On Sunday, 30 May 2021 at 07:03:38 UTC, Chris Piker wrote: On Thursday, 27 May 2021 at 07:00:32 UTC, Imperatorn wrote: I would like to recommend DlangUI [1], but we have tried now for months to get in contact with the owner of it (to take over development) and are getting no reponse. 1.

Re: How long does the context of a delegate exist?

2021-05-30 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 30 May 2021 at 09:39:28 UTC, cc wrote: Is there any way to enforce at compile time that we're not accidentally allocating when creating a delegate, other than being carefully aware of what variables are referenced inside the body? Use `function` instead of `delegate`. Then it

Re: How long does the context of a delegate exist?

2021-05-30 Thread Paul Backus via Digitalmars-d-learn
On Sunday, 30 May 2021 at 09:39:28 UTC, cc wrote: Is there any way to enforce at compile time that we're not accidentally allocating when creating a delegate, other than being carefully aware of what variables are referenced inside the body? Something like: ```d auto dg = delegate {...}

Re: How long does the context of a delegate exist?

2021-05-30 Thread cc via Digitalmars-d-learn
On Thursday, 27 May 2021 at 20:46:22 UTC, Adam D. Ruppe wrote: On Thursday, 27 May 2021 at 20:44:21 UTC, frame wrote: Did you mean to add the delegate as GC root or the data? The delegate.ptr property. Is there any way to enforce at compile time that we're not accidentally allocating when

Re: ChromeOS and DLang

2021-05-30 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Thursday, 27 May 2021 at 19:39:15 UTC, Ozan Sueel wrote: Hi I think about writing apps vor ChromeOS, but before running in a death end, I ask by myself, is D a good choice for this approach? I gather it is exactly the same situation as for Android, or?

Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-30 Thread evilrat via Digitalmars-d-learn
On Sunday, 30 May 2021 at 07:03:38 UTC, Chris Piker wrote: On Thursday, 27 May 2021 at 07:00:32 UTC, Imperatorn wrote: I would like to recommend DlangUI [1], but we have tried now for months to get in contact with the owner of it (to take over development) and are getting no reponse. 1.

Re: wanting to try a GUI toolkit: needing some advice on which one to choose

2021-05-30 Thread Chris Piker via Digitalmars-d-learn
On Thursday, 27 May 2021 at 07:00:32 UTC, Imperatorn wrote: I would like to recommend DlangUI [1], but we have tried now for months to get in contact with the owner of it (to take over development) and are getting no reponse. 1. https://github.com/buggins/dlangui Of the 107 forks of dlangui