Re: using __traits to get line number of a member

2021-11-12 Thread Ali Çehreli via Digitalmars-d-learn
On 11/12/21 11:00 PM, forkit wrote: > // nope. writes the line no. of the foreach loop mixin(m) seems to solve the issue, which I think necessitates 'static if': static foreach(m; __traits(allMembers, mixin(__MODULE__))) { static if(m == "std" || m == "object" || m == "main")

Re: using __traits to get line number of a member

2021-11-12 Thread forkit via Digitalmars-d-learn
On Saturday, 13 November 2021 at 06:05:37 UTC, Stanislav Blinov wrote: On Saturday, 13 November 2021 at 05:31:51 UTC, forkit wrote: Code below is self explanatory. Any assistance on how to get the line number is welcome ;-) https://dlang.org/spec/traits.html#getLocation That? Thanks. That

Re: using __traits to get line number of a member

2021-11-12 Thread Stanislav Blinov via Digitalmars-d-learn
On Saturday, 13 November 2021 at 05:31:51 UTC, forkit wrote: Code below is self explanatory. Any assistance on how to get the line number is welcome ;-) https://dlang.org/spec/traits.html#getLocation That?

using __traits to get line number of a member

2021-11-12 Thread forkit via Digitalmars-d-learn
Code below is self explanatory. Any assistance on how to get the line number is welcome ;-) // ++ module test; import std; class myClass{ void foo(){}} void myFunction1(){} void main() { // list the first user defined member of this module (other than main)

Re: How to use dmd code coverage

2021-11-12 Thread Imperatorn via Digitalmars-d-learn
On Friday, 12 November 2021 at 22:27:48 UTC, forkit wrote: On Friday, 12 November 2021 at 19:32:31 UTC, Dr Machine Code wrote: On Thursday, 11 November 2021 at 23:51:42 UTC, foxit wrote: [...] is your IDE more of a REPL thing? It's a custom IDE for me, that I wrote using Winforms/C# (devel

Re: Cannot compile C file using ImportC

2021-11-12 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Friday, 12 November 2021 at 08:12:22 UTC, Ola Fosheim Grøstad wrote: Maybe there are some metaprogramming advantages, but I cannot think of any. Well, one advantage might be that it could be easier to do escape analysis of C code. Not really sure if there is a difference compared to doing

Re: How to use dmd code coverage

2021-11-12 Thread forkit via Digitalmars-d-learn
On Friday, 12 November 2021 at 19:32:31 UTC, Dr Machine Code wrote: On Thursday, 11 November 2021 at 23:51:42 UTC, foxit wrote: On Thursday, 11 November 2021 at 22:35:21 UTC, forkit wrote: [...] Actually, the reason I got soo confused is clear to me now. I have my own GUI IDE, which I wr

Re: Dub says that there is an invalid semVer format, but I don't see how.

2021-11-12 Thread Ruby The Roobster via Digitalmars-d-learn
On Thursday, 11 November 2021 at 01:57:10 UTC, rikki cattermole wrote: On 11/11/2021 2:13 PM, Ruby The Roobster wrote: Branch ~master: Invalid SemVer format: testing.0.0 Branch ~testing: Invalid SemVer format: testing.0.0 Version 0.1.2: Invalid SemVer format: testing.0.0 testing is a branch.

Linker issues with DMD and LDC

2021-11-12 Thread Thomas Gregory via Digitalmars-d-learn
I get this error when trying to compile a program using [dhtslib](https://github.com/blachlylab/dhtslib) with DMD or any LDC version < 1.25.0. ``` _D39TypeInfo_S7dhtslib3sam6record9SAMRecord6__initZ: error: undefined reference to `_D7dhtslib3sam6record9SAMRecord15__fieldPostblitMFNbNiNlNeZv'

Re: How to use dmd code coverage

2021-11-12 Thread Dr Machine Code via Digitalmars-d-learn
On Thursday, 11 November 2021 at 23:51:42 UTC, foxit wrote: On Thursday, 11 November 2021 at 22:35:21 UTC, forkit wrote: [...] Actually, the reason I got soo confused is clear to me now. I have my own GUI IDE, which I wrote myself (winforms/C#) cause I got so fed up with creating/saving

Re: Is DMD still not inlining "inline asm"?

2021-11-12 Thread rempas via Digitalmars-d-learn
On Friday, 12 November 2021 at 15:10:19 UTC, max haughton wrote: Not always. The attribute is intended for naked asm since inlining could be completely wrong in this case. Got that! Thanks for the info!

Re: Is DMD still not inlining "inline asm"?

2021-11-12 Thread max haughton via Digitalmars-d-learn
On Friday, 12 November 2021 at 11:32:16 UTC, rempas wrote: On Thursday, 11 November 2021 at 19:22:33 UTC, max haughton wrote: There's an attribute to tell it the function is safe to inline. And can't you do that with inline asm? Not always. The attribute is intended for naked asm since inl

Re: Is DMD still not inlining "inline asm"?

2021-11-12 Thread rempas via Digitalmars-d-learn
On Friday, 12 November 2021 at 00:46:05 UTC, Elronnd wrote: GCC can do it. Somewhat notoriously, LTO can lead to bugs from underspecified asm constraints following cross-TU inlining. That's really interesting to hear! Do we have any cases where this happened to software that was used for pr

Re: Is DMD still not inlining "inline asm"?

2021-11-12 Thread rempas via Digitalmars-d-learn
On Thursday, 11 November 2021 at 19:22:33 UTC, max haughton wrote: There's an attribute to tell it the function is safe to inline. And can't you do that with inline asm?

Re: Cannot compile C file using ImportC

2021-11-12 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Thursday, 11 November 2021 at 02:03:22 UTC, Steven Schveighoffer wrote: I don't think ImportC is that much of a game changer (you can already make C bindings with quite a small effort, and there are tools to get you 90% there), but a broken/not working ImportC will be a huge drawback to the