Re: Set output location for dub --single

2022-02-28 Thread Basile B. via Digitalmars-d-learn
On Sunday, 27 February 2022 at 16:58:34 UTC, Chris Piker wrote: Hi D Coming from a python background it's worked well to organize my D projects as a dub `sourceLibrary` and then to put top level programs in a directory named `scripts` that are just dub single file projects. So the layout loo

Re: https://run.dlang.io/ vs All dmd compilers (2.060 - latest)

2022-02-28 Thread Basile B. via Digitalmars-d-learn
On Sunday, 27 February 2022 at 16:14:31 UTC, Matheus wrote: Hi, [...] After one minute I think I get: rdmd playground.d Server error: Thanks, Matheus. This was [reported before]. Apparently this would be caused by a timeout. [reported before]: https://forum.dlang.org/post/skc2dd$1o52$

Colors in Raylib

2022-02-28 Thread Salih Dincer via Digitalmars-d-learn
Hi All, Is there a namespace I should implement in Raylib? For example, I cannot compile without writing Colors at the beginning of the colors: ```Colors.GRAY``` SDB@79

Re: Colors in Raylib

2022-02-28 Thread Mike Parker via Digitalmars-d-learn
On Monday, 28 February 2022 at 11:48:59 UTC, Salih Dincer wrote: Hi All, Is there a namespace I should implement in Raylib? For example, I cannot compile without writing Colors at the beginning of the colors: ```Colors.GRAY``` SDB@79 Assuming you mean the raylib-d binding, it implements th

Re: Colors in Raylib

2022-02-28 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 28 February 2022 at 11:48:59 UTC, Salih Dincer wrote: Is there a namespace I should implement in Raylib? For example, I cannot compile without writing Colors at the beginning of the colors: ```Colors.GRAY``` When writing C bindings, you may refer to this: https://p0nce.github.io/d-i

Re: Colors in Raylib

2022-02-28 Thread Salih Dincer via Digitalmars-d-learn
On Monday, 28 February 2022 at 12:18:37 UTC, Mike Parker wrote: ```d enum expandEnum(EnumType, string fqnEnumType = EnumType.stringof) = (){ string expandEnum; foreach(m;__traits(allMembers, EnumType)) { expandEnum ~= "alias " ~ m ~ " = " ~ fqnEnumType ~ "." ~ m ~ ";"; }

Re: https://run.dlang.io/ vs All dmd compilers (2.060 - latest)

2022-02-28 Thread Matheus via Digitalmars-d-learn
On Monday, 28 February 2022 at 08:11:15 UTC, Basile B. wrote: This was [reported before]. Apparently this would be caused by a timeout. [reported before]: https://forum.dlang.org/post/skc2dd$1o52$1...@digitalmars.com Apparently yes, but I think the return error should be clear to avoid gues

Re: https://run.dlang.io/ vs All dmd compilers (2.060 - latest)

2022-02-28 Thread Matheus via Digitalmars-d-learn
On Monday, 28 February 2022 at 02:31:57 UTC, Mike Parker wrote: ... Hey Parker, I think my IP still under surveillance, everytime I post I get: "Your message has been saved, and will be posted after being approved by a moderator." With VPN I can post without problem. Could you please take

Re: https://run.dlang.io/ vs All dmd compilers (2.060 - latest)

2022-02-28 Thread Mike Parker via Digitalmars-d-learn
On Monday, 28 February 2022 at 17:44:57 UTC, Matheus wrote: On Monday, 28 February 2022 at 02:31:57 UTC, Mike Parker wrote: ... Hey Parker, I think my IP still under surveillance, everytime I post I get: "Your message has been saved, and will be posted after being approved by a moderator."

Re: Set output location for dub --single

2022-02-28 Thread Chris Piker via Digitalmars-d-learn
On Monday, 28 February 2022 at 08:03:24 UTC, Basile B. wrote: That 's not exactly what you ask for but you can define the path in the embedded recipe (targetPath) ```d #!/usr/bin/env dub /+ dub.sdl: dependency "mypackage" version="*" path=".." targetPath "./bin" +/ ``` Hey thanks! No

Re: https://run.dlang.io/ vs All dmd compilers (2.060 - latest)

2022-02-28 Thread Matheus via Digitalmars-d-learn
On Monday, 28 February 2022 at 17:49:36 UTC, Mike Parker wrote: ... Please try again. Testing. Matheus.

Re: https://run.dlang.io/ vs All dmd compilers (2.060 - latest)

2022-02-28 Thread Matheus via Digitalmars-d-learn
On Monday, 28 February 2022 at 19:00:58 UTC, Matheus wrote: On Monday, 28 February 2022 at 17:49:36 UTC, Mike Parker wrote: ... Please try again. Testing. Matheus. It worked thanks! Matheus.

Re: Colors in Raylib

2022-02-28 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/28/22 6:48 AM, Salih Dincer wrote: Hi All, Is there a namespace I should implement in Raylib? For example, I cannot compile without writing Colors at the beginning of the colors: ```Colors.GRAY``` SDB@79 If you refer to raylib-d, that's how it was since I've ever used it. The origina

Re: Colors in Raylib

2022-02-28 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 1 March 2022 at 02:42:52 UTC, Steven Schveighoffer wrote: On 2/28/22 6:48 AM, Salih Dincer wrote: In general, the raylib enumerations are overly verbose for D, e.g. `KeyboardKey.KEY_X`, instead of just `KeyboardKey.X`. I'd love to provide "better enums". In Derelict, I exclu

opCast in class prevents destroy

2022-02-28 Thread cc via Digitalmars-d-learn
```d struct A {} class B { A opCast(T : A)() { return A(); } } void main() { auto b = new B(); destroy(b); } ``` fails with ``` dmd2\windows\bin\..\..\src\druntime\import\object.d(4209): Error: template instance `opCast!(void*)` does not match templ

Re: opCast in class prevents destroy

2022-02-28 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 1 March 2022 at 04:29:56 UTC, cc wrote: ```d struct A {} class B { A opCast(T : A)() { return A(); } } void main() { auto b = new B(); destroy(b); } ``` fails with ``` dmd2\windows\bin\..\..\src\druntime\import\object.d(4209): Error: te

Re: opCast in class prevents destroy

2022-02-28 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 1 March 2022 at 04:59:49 UTC, Mike Parker wrote: You could also specialize on `void*`, as that's the type that was failing to compile I meant "instead", not also.

Re: opCast in class prevents destroy

2022-02-28 Thread bauss via Digitalmars-d-learn
On Tuesday, 1 March 2022 at 04:59:49 UTC, Mike Parker wrote: It makes sense to me, and I would say the bug is that it's not documented. Personally it doesn't make sense to me. I don't think it should override default behaviors, but just add onto it, so you can add an additional cast. Ri