std.process execute always returns -11 on linuxkit kernel

2022-02-25 Thread Bogdan via Digitalmars-d-learn
Hi everyone, I am trying to build dub in a docker container on a Mac M1 and unfortunately all processes started with the `execute` function from `std.process` always fails with -11. Because of this the `build.d` or `dub` are unusable on this environment. The container that I am using is

Re: How to check that a member function is generated by compiler?

2022-02-25 Thread Ali Çehreli via Digitalmars-d-learn
On 2/25/22 08:24, Paul Backus wrote: > I've seen `.stringof` give inconsistent results. (E.g., > https://issues.dlang.org/show_bug.cgi?id=18269) That must be a part of the reasons why Adam D Ruppe repeats that .stringof should not be used for such programmatic purposes e.g. if I remember

Re: How to check that a member function is generated by compiler?

2022-02-25 Thread Paul Backus via Digitalmars-d-learn
On Friday, 25 February 2022 at 19:06:25 UTC, Ali Çehreli wrote: On 2/25/22 08:24, Paul Backus wrote: > I've seen `.stringof` give inconsistent results. (E.g., > https://issues.dlang.org/show_bug.cgi?id=18269) That must be a part of the reasons why Adam D Ruppe repeats that .stringof should

Re: How to check that a member function is generated by compiler?

2022-02-25 Thread Andrey Zherikov via Digitalmars-d-learn
On Friday, 25 February 2022 at 05:25:14 UTC, Ali Çehreli wrote: On 2/24/22 20:44, Andrey Zherikov wrote: How can I check that `opAssign` is generated by compiler and doesn't exist in the original code? I think this one: https://dlang.org/phobos/std_traits.html#hasElaborateAssign Ali

Re: How to check that a member function is generated by compiler?

2022-02-25 Thread Paul Backus via Digitalmars-d-learn
On Friday, 25 February 2022 at 14:25:22 UTC, Andrey Zherikov wrote: Another interesting observation - is there any explanation why `typeof` returns different results for generated `opAssign`? [...] If I move `foreach` loop into a function (e.g. `main`) then the first pragma prints the same

Re: How to check that a member function is generated by compiler?

2022-02-25 Thread Andrey Zherikov via Digitalmars-d-learn
On Friday, 25 February 2022 at 16:24:46 UTC, Paul Backus wrote: On Friday, 25 February 2022 at 14:25:22 UTC, Andrey Zherikov wrote: Another interesting observation - is there any explanation why `typeof` returns different results for generated `opAssign`? [...] If I move `foreach` loop

template instance does not match template declaration

2022-02-25 Thread kdevel via Digitalmars-d-learn
``` $ dmd --version DMD64 D Compiler v2.098.1 [...] ``` ```main.d module main; // main.d import std.traits; import model; void main () { enum Q = Parameters!read; } ``` ```model.d module model; // model.d import std.file : read; // this line provokes the error int read (string filename) {

Re: How to programmatically get all the method names of an interface

2022-02-25 Thread mw via Digitalmars-d-learn
On Friday, 25 February 2022 at 23:28:21 UTC, Ali Çehreli wrote: On 2/25/22 14:05, mw wrote: Perhaps allMembers? https://dlang.org/spec/traits.html#allMembers Thank you, Ali. It kind of works, but "No name is repeated", in the example on that page: ``` void foo() { } int foo(int)

Re: template instance does not match template declaration

2022-02-25 Thread kdevel via Digitalmars-d-learn
On Friday, 25 February 2022 at 23:17:14 UTC, Paul Backus wrote: [...] Currently, selective imports are implemented using `alias`es under the hood, which means that the compiler sees your `model` module as having *two* overloads of `read`: ```d alias read = std.file.read; // from selective

Re: template instance does not match template declaration

2022-02-25 Thread Paul Backus via Digitalmars-d-learn
On Friday, 25 February 2022 at 23:34:59 UTC, kdevel wrote: What about this: ```d module model; // model.d import std.file : read; // this line provokes the error private int read (string filename) // now it's private { import std.file; auto data = std.file.read (filename); return 0;

Re: template instance does not match template declaration

2022-02-25 Thread Paul Backus via Digitalmars-d-learn
On Friday, 25 February 2022 at 23:05:00 UTC, kdevel wrote: It seems the template parameter f becomes not aliased to model.read in the presence of the selective import. Bug or feature? I'd call this a bug. Currently, selective imports are implemented using `alias`es under the hood, which

Re: How to programmatically get all the method names of an interface

2022-02-25 Thread Ali Çehreli via Digitalmars-d-learn
On 2/25/22 14:05, mw wrote: How to programmatically get all the method names of an interface; actually I want a flattened view, i.e also includes all the methods from its (many) ancestors, the whole inheritance lattice. Perhaps allMembers? https://dlang.org/spec/traits.html#allMembers The

How to programmatically get all the method names of an interface

2022-02-25 Thread mw via Digitalmars-d-learn
How to programmatically get all the method names of an interface; actually I want a flattened view, i.e also includes all the methods from its (many) ancestors, the whole inheritance lattice.

Re: template instance does not match template declaration

2022-02-25 Thread kdevel via Digitalmars-d-learn
```main.d module main; // main.d import std.traits; import model; void main () { enum Q = Parameters!read; } ``` Will not compile with selective import commented out. Hence main.d must read (alias instead of enum): ```main.d module main; // main.d import std.traits; import model; void

Re: How to programmatically get all the method names of an interface

2022-02-25 Thread Ali Çehreli via Digitalmars-d-learn
On 2/25/22 16:00, mw wrote: > only one "foo" is returned, how do I get the signature info of these two > different methods? (I'm trying to do some introspection of D code, is > this possible?) I will let others to correct me but getOverloads is what I would start to struggle with myself: