Re: Simple BeamUI project won't link

2020-12-15 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Wednesday, 16 December 2020 at 07:40:45 UTC, Ferhat Kurtulmuş wrote: On Wednesday, 16 December 2020 at 07:02:11 UTC, Daren Scot Wilson wrote: Trying out the beamui GUI package, obtained by git clone from github. The "basic" example builds and runs. I'm working on an Arch Linux machine with

Re: Simple BeamUI project won't link

2020-12-15 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Wednesday, 16 December 2020 at 07:02:11 UTC, Daren Scot Wilson wrote: Trying out the beamui GUI package, obtained by git clone from github. The "basic" example builds and runs. I'm working on an Arch Linux machine with lots of RAM, but a user with not enough practice at D yet. I have a l

Simple BeamUI project won't link

2020-12-15 Thread Daren Scot Wilson via Digitalmars-d-learn
Trying out the beamui GUI package, obtained by git clone from github. The "basic" example builds and runs. So I create a new project from scratch, with "dub init beamy beamui" (ircc) in a directory outside beamui's, sibling to it in fact. This builds and runs, but does not make use of beamui

Re: extern(C) and name mangling

2020-12-15 Thread Jacob Carlborg via Digitalmars-d-learn
On Wednesday, 16 December 2020 at 04:17:13 UTC, Mike Parker wrote: So what you're asking for is a way to retain the D name mangling on an extern C function. The way to do that is with `pragma(mangle, "new_name")`. To match the original D function mangling, declare the function first without ex

Re: extern(C) and name mangling

2020-12-15 Thread Jacob Carlborg via Digitalmars-d-learn
On Wednesday, 16 December 2020 at 04:17:13 UTC, Mike Parker wrote: However, the D calling convention is defined to be identical to the C calling convention on the host system for everything except Windows x86. Also keep in mind that D supports other types than C does, like D arrays and deleg

Re: extern(C) and name mangling

2020-12-15 Thread Jacob Carlborg via Digitalmars-d-learn
On Wednesday, 16 December 2020 at 04:17:13 UTC, Mike Parker wrote: However, the D calling convention is defined to be identical to the C calling convention on the host system for everything except Windows x86. That's what's specified, but that's not how DMD actually behaves. DMD passes the a

Updating to newer files with different disk formats

2020-12-15 Thread Joel via Digitalmars-d-learn
I found using timeLastModified from macOS drive to ExFat, macOS has higher precision than ExFat[0], so a different number. My little program lists the files to update, but I get files to update still, after updating them, because of the differences with the disk formats. [0] from time: 2020-N

Re: extern(C) and name mangling

2020-12-15 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 16 December 2020 at 04:45:34 UTC, Dave P. wrote: Oh interesting, so I only need extern(C) for declaring symbols I’m linking to and for symbols I want to export to C. I had sort of assumed that D might have different calling conventions for different things, but that makes thing

Re: UFCS functions with both pointers and refs

2020-12-15 Thread Dave P. via Digitalmars-d-learn
On Wednesday, 16 December 2020 at 03:50:07 UTC, Mike Parker wrote: On Sunday, 13 December 2020 at 19:02:34 UTC, Dave P. wrote: On Sunday, 13 December 2020 at 18:44:20 UTC, Mike Parker wrote: On Sunday, 13 December 2020 at 18:31:54 UTC, Dave P. wrote: [...] Based on you requirement to use poin

Re: extern(C) and name mangling

2020-12-15 Thread Dave P. via Digitalmars-d-learn
On Wednesday, 16 December 2020 at 04:17:13 UTC, Mike Parker wrote: On Tuesday, 15 December 2020 at 22:04:12 UTC, Dave P. wrote: [...] Mangling does not play any role in passing and calling function pointers between D and C. It only plays a role in linking and loading. You can declare functio

Re: extern(C) and name mangling

2020-12-15 Thread Ali Çehreli via Digitalmars-d-learn
On 12/15/20 2:04 PM, Dave P. wrote: > I want to pass > some templated functions as function pointers to some C code As Mike Parker said, it works: // The same thing as a C function pointer: alias Func = long function(int); long bar(T)(int) { return 0; } Func f0 = &(bar!float); Func d1 = &(b

Re: extern(C) and name mangling

2020-12-15 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 15 December 2020 at 22:04:12 UTC, Dave P. wrote: I can’t find this in the spec, but from experimentation it seems like extern(C) only affects name mangling of functions at the top level scope. Thus extern(C) function templates would be mangled differently, but still use the C callin

Re: UFCS functions with both pointers and refs

2020-12-15 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 13 December 2020 at 19:02:34 UTC, Dave P. wrote: On Sunday, 13 December 2020 at 18:44:20 UTC, Mike Parker wrote: On Sunday, 13 December 2020 at 18:31:54 UTC, Dave P. wrote: Do I have to write both and have one forward to the other for more complicated functions? For free functions

Re: closures + struct: Error: forward reference to inferred return type of function call

2020-12-15 Thread ddcovery via Digitalmars-d-learn
On Tuesday, 15 December 2020 at 19:53:33 UTC, Q. Schroll wrote: On Monday, 14 December 2020 at 14:39:14 UTC, ddcovery wrote: On Monday, 14 December 2020 at 12:22:26 UTC, ddcovery wrote: int opCmp(Number other){ return _value - other.value; }; Correction: bool opEquals(Number oth

extern(C) and name mangling

2020-12-15 Thread Dave P. via Digitalmars-d-learn
I can’t find this in the spec, but from experimentation it seems like extern(C) only affects name mangling of functions at the top level scope. Thus extern(C) function templates would be mangled differently, but still use the C calling convention. Is this right? I want to pass some templated f

Re: UFCS functions with both pointers and refs

2020-12-15 Thread Dave P. via Digitalmars-d-learn
On Tuesday, 15 December 2020 at 19:45:50 UTC, Q. Schroll wrote: On Sunday, 13 December 2020 at 19:02:34 UTC, Dave P. wrote: On Sunday, 13 December 2020 at 18:44:20 UTC, Mike Parker wrote: On Sunday, 13 December 2020 at 18:31:54 UTC, Dave P. wrote: Do I have to write both and have one forward to

Re: closures + struct: Error: forward reference to inferred return type of function call

2020-12-15 Thread Q. Schroll via Digitalmars-d-learn
On Monday, 14 December 2020 at 14:39:14 UTC, ddcovery wrote: On Monday, 14 December 2020 at 12:22:26 UTC, ddcovery wrote: int opCmp(Number other){ return _value - other.value; }; Correction: bool opEquals(Number other){ return _value == other.value; }; You could just give the

Re: UFCS functions with both pointers and refs

2020-12-15 Thread Q. Schroll via Digitalmars-d-learn
On Sunday, 13 December 2020 at 19:02:34 UTC, Dave P. wrote: On Sunday, 13 December 2020 at 18:44:20 UTC, Mike Parker wrote: On Sunday, 13 December 2020 at 18:31:54 UTC, Dave P. wrote: Do I have to write both and have one forward to the other for more complicated functions? For free functions

Getting started with graphqld

2020-12-15 Thread Trustee via Digitalmars-d-learn
Is there anyone willing to help me get started with GraphQLD. I have some experience with graphql in node. My D is intermediate at best but i can learn fast with guidance. I am able to build and deploy vibe-d apps locally and on heroku. Basically, I'm looking for someone to stand-in in lieu of

Paper comparing languages with egs?

2020-12-15 Thread mark via Digitalmars-d-learn
I _think_ I remember seeing somewhere on the D site a reference to a paper on a comparison of programming languages that used a few small programs written in each compared language. I can't recall if D was one of the languages in the paper or whether someone had done D versions separately. Can