Tab completion using neovim

2023-01-21 Thread Alain De Vos via Digitalmars-d-learn
Let's say i write "write" press tab in neovim i want it to guess "writeln". How to configure neovim for this. [ Note "ncm2" lets my neovim crash. But maybe there are alternatives ] [ vscode is not an option as compiling electron takes ages]

Re: Tab completion using neovim

2023-01-21 Thread Sergey via Digitalmars-d-learn
On Saturday, 21 January 2023 at 13:17:44 UTC, Alain De Vos wrote: Let's say i write "write" press tab in neovim i want it to guess "writeln". How to configure neovim for this. [ Note "ncm2" lets my neovim crash. But maybe there are alternatives ] [ vscode is not an option as compiling electron

Re: Tab completion using neovim

2023-01-21 Thread Alain De Vos via Digitalmars-d-learn
I managed after some tuning. cat coc-settings.json ``` { "languageserver": { "d": { "command": "/usr/home/x/serve-d/serve-d", "filetypes": ["d"], "trace.server": "on", "r

Re: Tab completion using neovim

2023-01-21 Thread Alain De Vos via Digitalmars-d-learn
``` call dutyl#register#tool('dcd-client','dcd-client') call dutyl#register#tool('dcd-server','dcd-server') call deoplete#custom#option('auto_complete_delay',200) ```

Re: Pyd examples or resources for Python 3.x

2023-01-21 Thread Seamus via Digitalmars-d-learn
Thanks for all the suggestions folks! I will take a look. Cheers.

How to write a library

2023-01-21 Thread Matt via Digitalmars-d-learn
I am trying to write a graphics engine for my university capstone project, and really wanted to give it a try in D, as both a talking point, and because I love the language. I'm using dub to build the library, and the demo application that'll use it. However, I've come across a problem. In C/C

Re: How to write a library

2023-01-21 Thread Adam D Ruppe via Digitalmars-d-learn
On Saturday, 21 January 2023 at 22:53:19 UTC, Matt wrote: but what is the D equivalent to header files, and what do I have to do to prepare and use my library in another project? The most common and easiest thing in D is to just distribute the source files, the compiler can pull whatever it ne

More Elegant Settable Methods?

2023-01-21 Thread jwatson-CO-edu via Digitalmars-d-learn
Hi, I am trying to create a struct with a settable method that has access to the struct scope. Is this the only way? Is there a way to give access without explicitly passing `this`? ```d import std.stdio; struct TestStruct{ float /*--*/ a; float /*--*/

Re: How to write a library

2023-01-21 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/21/23 5:53 PM, Matt wrote: I am trying to write a graphics engine for my university capstone project, and really wanted to give it a try in D, as both a talking point, and because I love the language. I'm using dub to build the library, and the demo application that'll use it. However, I

Re: How to write a library

2023-01-21 Thread Hipreme via Digitalmars-d-learn
On Saturday, 21 January 2023 at 22:53:19 UTC, Matt wrote: I am trying to write a graphics engine for my university capstone project, and really wanted to give it a try in D, as both a talking point, and because I love the language. I'm using dub to build the library, and the demo application t

Re: More Elegant Settable Methods?

2023-01-21 Thread ryuukk_ via Digitalmars-d-learn
Oops i clicked "Send" too fast

Re: More Elegant Settable Methods?

2023-01-21 Thread ryuukk_ via Digitalmars-d-learn
```D TestStruct ts = { a: 2, b: 3, op: (s) { return s.a + s.b; } }; ``` This simple! just like with C's designated initializers

Function which returns a sorted array without duplicates

2023-01-21 Thread dan via Digitalmars-d-learn
I would like to write a function which takes an array as input, and returns a sorted array without duplicates. In fact, i have a function which does this, but i think it may have some extra unnecessary steps. ```d private S[] _sort_array( S )( S[] x ) { import std.algorithm; a

Re: Function which returns a sorted array without duplicates

2023-01-21 Thread evilrat via Digitalmars-d-learn
On Sunday, 22 January 2023 at 04:42:09 UTC, dan wrote: I would like to write a function which takes an array as input, and returns a sorted array without duplicates. ```d private S[] _sort_array( S )( S[] x ) { import std.algorithm; auto y = x.dup; y.sort; auto z =