Re: How to pre build vibe-d dub package

2020-05-29 Thread kookman via Digitalmars-d-learn
On Friday, 29 May 2020 at 11:45:24 UTC, Andre Pany wrote: André I do it by defining a configuration “build-deps” in my dub.sdl with target type “none” and then doing the build as two steps in the dockerfile: ``` dockerfile ... WORKDIR /build COPY dub.s* ./ RUN dub build -v

Re: A custom name for variables

2020-05-29 Thread solidstate1991 via Digitalmars-d-learn
On Thursday, 28 May 2020 at 20:26:55 UTC, Quantium wrote: I need to create a variable with custom name, like this import std; void main() { string name; readf(" %s", ); // some code that generates a variable of type integer and value 0 } Could you help me with that? This might be

Re: A custom name for variables

2020-05-29 Thread Liu via Digitalmars-d-learn
On Thursday, 28 May 2020 at 20:26:55 UTC, Quantium wrote: I need to create a variable with custom name, like this import std; void main() { string name; readf(" %s", ); // some code that generates a variable of type integer and value 0 } Could you help me with that? This is not

Re: Determining @trusted-status

2020-05-29 Thread Clarice via Digitalmars-d-learn
I didn't know the spec was changed to include a section on @safe/@trusted/@system interfaces, because otherwise I wouldn't have made this thread. But regardless, thank you everyone for your time: your posts are very helpful.

Re: Determining @trusted-status

2020-05-29 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/28/20 8:09 PM, Clarice wrote: It seems that @safe will be de jure, whether by the current state of DIP1028 or otherwise. However, I'm unsure how to responsibly determine whether a FFI may be @trusted: the type signature and the body. Should I run, for example, a C library through valgrind

How to pre build vibe-d dub package

2020-05-29 Thread Andre Pany via Digitalmars-d-learn
Hi, I have a docker image in which a vibe-d application is build from source code. Every time a file is changed, unfortunately the whole vibe-d dub packages are retrieved again from dub registry and compiled again (which takes ages). In my app.json I have these dependency declaration: ```

Re: [Windows]Need an example: How to read and list names of USB devices via Windows API without using Utilities

2020-05-29 Thread WebFreak001 via Digitalmars-d-learn
On Friday, 29 May 2020 at 09:04:30 UTC, WebFreak001 wrote: [...] I realized it may be useful to have a much more complete example, so replace the while (true) loop in my first code with this to get much more information dumped: while (true) {

Re: [Windows]Need an example: How to read and list names of USB devices via Windows API without using Utilities

2020-05-29 Thread WebFreak001 via Digitalmars-d-learn
On Wednesday, 27 May 2020 at 14:16:56 UTC, BoQsc wrote: I always wanted to know if there is any proven example on how to interface with USB devices by using Windows operating system. Any explanations, snippets in relation to topic would help. What I expect: Being able to detect if a new USB

Re: Determining @trusted-status

2020-05-29 Thread ag0aep6g via Digitalmars-d-learn
On 29.05.20 08:28, JN wrote: Alternatively you could just use @trusted blocks. Unsafe blocks are a common practice in languages like C# or Rust when it comes to calling unsafe code. @safe isn't about 100% bulletproof safety. @safe is (should be) about not having memory related errors outside

Re: Determining @trusted-status

2020-05-29 Thread ag0aep6g via Digitalmars-d-learn
On 29.05.20 02:09, Clarice wrote: It seems that @safe will be de jure, whether by the current state of DIP1028 or otherwise. However, I'm unsure how to responsibly determine whether a FFI may be @trusted: the type signature and the body. Should I run, for example, a C library through valgrind

Re: Determining @trusted-status

2020-05-29 Thread JN via Digitalmars-d-learn
On Friday, 29 May 2020 at 00:09:56 UTC, Clarice wrote: It seems that @safe will be de jure, whether by the current state of DIP1028 or otherwise. However, I'm unsure how to responsibly determine whether a FFI may be @trusted: the type signature and the body. Should I run, for example, a C