On Saturday, 10 September 2022 at 22:07:32 UTC, Ali Çehreli wrote:
On 9/10/22 13:04, Daniel Donnell wrote:
> https://dlang.org/spec/cpp_interface.html
At DConf, Manu indicated that that page is outdated and that
D's C++ support is actually a lot better.
Update it quickly, This is a big selli
On Sunday, 11 September 2022 at 00:32:18 UTC, Kyle Ingraham wrote:
I can't use default parameters because I want to be able to
call the delegate with arguments extracted from a URL path at
runtime
Some kind of wrapper might not only be your best option, it might
be your only option.
Your de
On Sunday, 11 September 2022 at 00:04:55 UTC, Adam D Ruppe wrote:
On Saturday, 10 September 2022 at 23:37:30 UTC, Kyle Ingraham
wrote:
How can I write a type that is strict for the first two
parameters but tolerant of any other parameter following those?
That's not a type per se, but you can a
On Saturday, 10 September 2022 at 23:37:30 UTC, Kyle Ingraham
wrote:
How can I write a type that is strict for the first two
parameters but tolerant of any other parameter following those?
That's not a type per se, but you can assign wrapper at the
assignment thing.
Like
your_delegate = (a,
Is there a way to write a delegate type as being specific for
some parameters and tolerant of anything for others? For example,
I can specify this type:
```d
alias MyDelegateType = void delegate(string name, int age);
```
It would be compatible with a pointer to this function converted
to a d
On 9/10/22 15:35, jwatson-CO-edu wrote:
> So, my solution
> will be to construct a catch-all struct `Payload` and have that be my
> argument type from which various functions can draw the data of their
> choice.
Two Phobos features may be helpful there:
https://dlang.org/phobos/std_sumtype.ht
On Saturday, 10 September 2022 at 22:13:01 UTC, frame wrote:
On Saturday, 10 September 2022 at 00:24:11 UTC, jwatson-CO-edu
wrote:
Hello,
I'm trying to create a dictionary of templated function
pointers. The functions should return `bool` and take a
differently-typed dynamics arrays `T[]` as
On Saturday, 10 September 2022 at 00:24:11 UTC, jwatson-CO-edu
wrote:
Hello,
I'm trying to create a dictionary of templated function
pointers. The functions should return `bool` and take a
differently-typed dynamics arrays `T[]` as an argument.
This won't work as you might expect. Your conta
On 9/10/22 13:04, Daniel Donnell wrote:
> https://dlang.org/spec/cpp_interface.html
At DConf, Manu indicated that that page is outdated and that D's C++
support is actually a lot better. He kind-of-promised to update that
page but I doubt it happened yet if ever. :)
> one has to be compiled b
I seem to have found a solution.
Before starting neovim i do a,
dcd-server -I/usr/lib/ldc2/1.29/include/d
Automatic would be better.
I try neovim editor with the language server DCD but it seems no
symbols our found.
Could you guide me to solution ?
https://dlang.org/spec/cpp_interface.html
According to that C++ / D .object files can interoperate both
ways, but one has to be compiled before the other, order
depending on direction.
My question is, can you have a class C (C++) use a class D
(Dlang) in such a way that D can also use C as i
On 9/10/22 09:33, Erdem Demir wrote:
> DListOfA returnVal = temp.require("a", DListOfA());--> I wish I
> could use ref DListOfA here
But keeping a reference to a temporary would not work because the life
of that temporary ends by the end of that expression (practically, at
the semicol
On 9/10/22 12:33 PM, Erdem Demir wrote:
Can you please suggest alternatives?
Use a pointer.
```d
DListOfA *returnVal = &temp.require(...);
returnVal.insert(a);
```
-Steve
On Saturday, 10 September 2022 at 17:20:29 UTC, H. S. Teoh wrote:
On Sat, Sep 10, 2022 at 04:59:50PM +, Injeckt via
Digitalmars-d-learn wrote:
I'm trying use classes in my project, but when i'm try inherit
class, I get error:
Error: import `Server.Console` is used as a type
[...]
On Sat, Sep 10, 2022 at 04:59:50PM +, Injeckt via Digitalmars-d-learn wrote:
> I'm trying use classes in my project, but when i'm try inherit class,
> I get error:
>
> Error: import `Server.Console` is used as a type
[...]
Don't name the module the same thing as the class. Rename it
I'm trying use classes in my project, but when i'm try inherit
class, I get error:
Error: import `Server.Console` is used as a type
Server.d:
module Server;
import std.string;
import core.sys.windows.windows;
import Console;
class Server : Con
import std;
struct A
{
double val;
bool isBig;
}
void main() {
alias DListOfA = DList!A;
DListOfA[string] temp;
A a = {2.0, true};
DListOfA returnVal = temp.require("a", DListOfA());--> I
wish I could use ref DListOfA here
On Friday, 9 September 2022 at 06:13:07 UTC, brian wrote:
I'd like to use D for some visualisation in XR, but without
OpenXR, I'm stuck before I even start.
I have tried before to write the library bindings
(https://github.com/infinityplusb/OpenXR-D), but got stuck and
honestly don't know eno
On Saturday, 10 September 2022 at 10:39:12 UTC, Injeckt wrote:
To elaborate on why you need the above...
But I get these bugs:
WndProc is a function, and you can't pass a function as a runtime
function parameter, only pointers to functions. The first two
errors tell you exactly what the pro
On Saturday, 10 September 2022 at 10:39:12 UTC, Injeckt wrote:
And after all, I call it:
KK_CreateWindowClass(WndProc);
`KK_CreateWindowClass(&WndProc);`
On Saturday, 10 September 2022 at 10:39:12 UTC, Injeckt wrote:
server.d(29): Error: function `server.WndProc(void* hwnd, uint
message, uint wParam, int lParam)` is not callable using
argument types `()`
I think you need to get address of a function:
```d
wndclass.lpfnWndProc = &WndProc;
```
On Saturday, 10 September 2022 at 10:39:12 UTC, Injeckt wrote:
utils.d(52): Error: cannot implicitly convert expression
`*WndProc` of type `nothrow @system extern (Windows) int(void*,
uint, uint, int)` to `extern (Windows) int function(void*, uint,
uint, int) nothrow @system`
I define this function:
extern(Windows)
static LRESULT WndProc(HWND hwnd, UINT message, WPARAM
wParam, LPARAM lParam) nothrow {
return 0;
}
Then I define in another .d file:
void KK_CreateWindowClass(WNDPROC WndProc) {
WNDCLASSEX wndclass;
wndclass.lpfn
On Sunday, 14 August 2022 at 02:30:43 UTC, Paul Backus wrote:
On Sunday, 14 August 2022 at 02:07:05 UTC, Ali Çehreli wrote:
This automatic "combining" of exceptions happens for cleanup
code like scope(exit). (I remember bug(s) for scope(failure).):
To be precise, an exception thrown inside a
25 matches
Mail list logo