Re: Dexed can be used to debug program that are not written in D

2021-09-06 Thread Basile B. via Digitalmars-d-debugger
On Wednesday, 1 September 2021 at 17:08:30 UTC, Imperatorn wrote: On Friday, 27 August 2021 at 17:34:34 UTC, Basile B. wrote: Select a custom executable, that's been compiled with dwarf info (e.g -g). this custom executable has not to be related to the focused project. [...] Cool. Great

Dexed can be used to debug program that are not written in D

2021-08-27 Thread Basile B. via Digitalmars-d-debugger
Select a custom executable, that's been compiled with dwarf info (e.g -g). this custom executable has not to be related to the focused project. ![](https://i.imgur.com/6XCONPS.png) it even has not to be written in D. For example here I debug an obscure program written using an obscure

Re: issue with static foreach

2021-07-22 Thread Basile B. via Digitalmars-d-learn
On Thursday, 22 July 2021 at 05:57:02 UTC, jfondren wrote: On Thursday, 22 July 2021 at 03:43:44 UTC, someone wrote: ... it compiles no-more: Error: found `End of File` when expecting `}` following compound statement ... what I am doing wrong ? You'll get the same error from this code:

Re: LLVM asm with constraints, and 2 operands

2021-07-19 Thread Basile B. via Digitalmars-d-learn
On Monday, 19 July 2021 at 10:21:58 UTC, kinke wrote: On Sunday, 18 July 2021 at 16:32:46 UTC, Basile B. wrote: - **=x** says "returns in whatever is has to" - **x** (1) is the constraint for input `a`, which is passed as operand **$0** - **x** (2) is the constraint for input `b`, which is

Re: LLVM asm with constraints, and 2 operands

2021-07-18 Thread Basile B. via Digitalmars-d-learn
On Sunday, 18 July 2021 at 17:45:05 UTC, Guillaume Piolat wrote: On Sunday, 18 July 2021 at 16:32:46 UTC, Basile B. wrote: [...] Thanks. Indeed that seems to work even when inline and optimized. Registers are spilled to stack. A minor concern is what happens when the enclosing function is

Re: LLVM asm with constraints, and 2 operands

2021-07-18 Thread Basile B. via Digitalmars-d-learn
On Sunday, 18 July 2021 at 18:47:50 UTC, Basile B. wrote: On Sunday, 18 July 2021 at 17:45:05 UTC, Guillaume Piolat wrote: On Sunday, 18 July 2021 at 16:32:46 UTC, Basile B. wrote: [...] Thanks. Indeed that seems to work even when inline and optimized. Registers are spilled to stack. A

Re: LLVM asm with constraints, and 2 operands

2021-07-18 Thread Basile B. via Digitalmars-d-learn
On Sunday, 18 July 2021 at 11:42:24 UTC, Guillaume Piolat wrote: Is anyone versed in LLVM inline asm? I know how to generate SIMD unary op with: return __asm!int4("pmovsxwd $1,$0","=x,x",a); but I struggle to generate 2-operands SIMD ops like: return __asm!int4("paddd

Re: Faster Dlang Execution

2021-06-08 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 8 June 2021 at 17:10:47 UTC, seany wrote: Hello How can I increase the speed of executable files created via : `dub build -b release` try `dub build -b release --compiler=ldc2` Then you can set some specific DFlags for ldc, like -O3 or --mcpu I am unable to parallellise all of

Re: Compiler Explorer Assembly Output for C, C++ and D (dlang)

2021-05-27 Thread Basile B. via Digitalmars-d-learn
On Thursday, 27 May 2021 at 08:47:50 UTC, Tariq Siddiqui wrote: When using Compiler Explorer (https://godbolt.org/) to compare assembly output of simple programs, why D language assembly output is so long compared to C or C++ output. The simple square function output is the same for C, C++,

Re: Beta 2.097.0

2021-05-13 Thread Basile B. via Digitalmars-d-announce
On Thursday, 13 May 2021 at 15:26:59 UTC, Berni44 wrote: On Thursday, 13 May 2021 at 13:38:44 UTC, jmh530 wrote: "11. Floating point numbers don't allocate with the GC anymore." Should this be "11. Formatting floating point numbers doesn't allocate with the GC anymore." Probably my fault.

Re: cannot I override and mark it as private?

2021-05-12 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 12 May 2021 at 19:35:31 UTC, Jack wrote: I'd to change the visibility of a method overrided from public to private but it doesn't work tho to protected it does. Why is that? ... Why is that? why must I leave it accessible somehow (even if it's protected) to all derived class of

Re: alias & local function

2021-05-09 Thread Basile B. via Digitalmars-d-learn
On Monday, 10 May 2021 at 01:25:10 UTC, Alain De Vos wrote: This does not: ``` import std.stdio; void main() { int afunction(int x){return x;}; it's not static so -> context -> delegate alias myint = int; myint i=5;

Re: class grammar

2021-05-07 Thread Basile B. via Digitalmars-d-learn
On Friday, 7 May 2021 at 18:07:45 UTC, Nick wrote: The class grammar, as defined in the D language specification ... is not clear to me how a user-defined type (such as a class or interface) is also a 'BasicType' (as defined by the grammar). However, the compiler only accepts classes or

Re: Since dmd 2.096.0: import `x.t` is used as a type

2021-05-02 Thread Basile B. via Digitalmars-d-learn
On Sunday, 2 May 2021 at 15:41:13 UTC, kdevel wrote: On Saturday, 1 May 2021 at 16:32:32 UTC, Basile B. wrote: Hard breakage is not acceptable, even if the goal is to introduce a more correct behavior. I still wonder why module names are taken as a candidates for types and functions in the

Re: Fake IFTI-compatible struct constructors

2021-05-01 Thread Basile B. via Digitalmars-d-learn
On Saturday, 1 May 2021 at 21:57:54 UTC, Chad Joan wrote: I came up with a couple techniques for making it seem like templated structs deduce their template parameters from constructor invocations. These are given further down in the post. ... However, this was not to be. Rather, this setup

Re: Since dmd 2.096.0: import `x.t` is used as a type

2021-05-01 Thread Basile B. via Digitalmars-d-learn
On Friday, 30 April 2021 at 21:41:43 UTC, kdevel wrote: On Friday, 30 April 2021 at 19:17:14 UTC, user1234 wrote: [...] Likely a side effect of https://github.com/dlang/dmd/pull/12178 but according to me the new behavior is correct. It breaks my code. I have files named $C containing struct

Re: Derived type

2021-03-31 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 31 March 2021 at 04:49:50 UTC, novice3 wrote: On Tuesday, 30 March 2021 at 21:53:34 UTC, Basile B. wrote: struct Typedef(TBase) { TBase payload; alias payload this; } alias Xobj = Typedef!(void*); This is how std.typecons.Typedef made, IMHO. The problem is this code

Re: Derived type

2021-03-30 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 30 March 2021 at 19:47:41 UTC, novice2 wrote: My tries to make template for struct and alias this: // variant 1 template Typedef(alias Tnew, Tbase) { struct Tnew { Tbase payload; alias payload this; } } you must give a name to the template specialization, using

Re: Using onOutOfMemoryError in C wrappers

2021-03-24 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 24 March 2021 at 08:51:34 UTC, Per Nordlöw wrote: On Wednesday, 24 March 2021 at 08:31:19 UTC, Basile B. wrote: There are several ways to do that. In addition to onOutOfMemoryError, you can use a static instance void v() @nogc nothrow { __gshared oom = new

Re: Using onOutOfMemoryError in C wrappers

2021-03-24 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 24 March 2021 at 07:58:22 UTC, Per Nordlöw wrote: When wrapping C code that tries to allocate memory resources via functions such as X* X_create(); should one call `onOutOfMemoryError();` upon null return? Making more D wrappers `nothrow @nogc`. There are several ways to

Re: Checking for manifest constants

2021-03-05 Thread Basile B. via Digitalmars-d-learn
On Friday, 5 March 2021 at 08:23:09 UTC, Bogdan wrote: I was using a trick with dmd to check for manifest constants which worked until dmd v2.094. Yesterday I tried it on the latest compiler and it failed with: source/introspection/manifestConstant.d(37,28): Error: need this for name of

Re: Dimensions in compile time

2021-02-08 Thread Basile B. via Digitalmars-d-learn
On Monday, 8 February 2021 at 13:27:14 UTC, Vindex wrote: Thanks everyone! The solution that works for me now looks like this: template ndim(T) { static if (std.traits.isArray!T) { static if (is(typeof(T.init[0]))) { alias SubArrayType = typeof(T.init[0]);

Re: Dimensions in compile time

2021-02-08 Thread Basile B. via Digitalmars-d-learn
On Monday, 8 February 2021 at 13:13:33 UTC, Basile B. wrote: On Monday, 8 February 2021 at 13:09:53 UTC, Rumbu wrote: On Monday, 8 February 2021 at 12:19:26 UTC, Basile B. wrote: [...] dimensionCount!string should be 2. My take without std.traits: template rank(T: U[], U) { enum rank =

Re: Dimensions in compile time

2021-02-08 Thread Basile B. via Digitalmars-d-learn
On Monday, 8 February 2021 at 13:09:53 UTC, Rumbu wrote: On Monday, 8 February 2021 at 12:19:26 UTC, Basile B. wrote: [...] dimensionCount!string should be 2. My take without std.traits: template rank(T: U[], U) { enum rank = 1 + rank!U; } template rank(T: U[n], size_t n) { enum

Re: Dimensions in compile time

2021-02-08 Thread Basile B. via Digitalmars-d-learn
On Monday, 8 February 2021 at 12:19:26 UTC, Basile B. wrote: On Monday, 8 February 2021 at 11:42:45 UTC, Vindex wrote: [...] yeah. --- template dimensionCount(T) { static if (isArray!T) { static if (isMultiDimensionalArray!T) { alias DT =

Re: Dimensions in compile time

2021-02-08 Thread Basile B. via Digitalmars-d-learn
On Monday, 8 February 2021 at 11:42:45 UTC, Vindex wrote: size_t ndim(A)(A arr) { return std.algorithm.count(typeid(A).to!string, '['); } Is there a way to find out the number of dimensions in an array at compile time? yeah. --- template dimensionCount(T) { static if (isArray!T)

Re: core.atomic for ldc.

2021-01-31 Thread Basile B. via Digitalmars-d-learn
On Monday, 1 February 2021 at 06:12:59 UTC, vitamin wrote: On Monday, 1 February 2021 at 05:23:52 UTC, rikki cattermole wrote: The only difference between dmd, ldc and gdc (in effect) is the backend. While druntime and Phobos will be patched for other platform targets, over all its the same

Re: styx, a programming languange written in D, is on the bootstrap path

2021-01-19 Thread Basile B. via Digitalmars-d-announce
On Tuesday, 19 January 2021 at 12:50:40 UTC, Max Haughton wrote: On Friday, 15 January 2021 at 19:18:09 UTC, Basile B. wrote: On Friday, 15 January 2021 at 09:54:59 UTC, Ola Fosheim Grøstad wrote: [...] self-hosting is not started yet, maybe next month, classes are still to be implemented.

Re: styx, a programming languange written in D, is on the bootstrap path

2021-01-18 Thread Basile B. via Digitalmars-d-announce
On Monday, 18 January 2021 at 18:03:12 UTC, IGotD- wrote: On Thursday, 14 January 2021 at 17:51:51 UTC, Basile B. wrote: This is the last[1] occasion to speak about a programming language initiatly made in D, as the bootstrap phase is very near. I'd like to thank the D compiler developers,

Re: styx, a programming languange written in D, is on the bootstrap path

2021-01-18 Thread Basile B. via Digitalmars-d-announce
On Monday, 18 January 2021 at 17:51:16 UTC, Basile B. wrote: On Monday, 18 January 2021 at 17:45:16 UTC, Basile B. wrote: On Friday, 15 January 2021 at 19:40:11 UTC, Ola Fosheim Grøstad wrote: [...] Yeah, in addition to my real name, I've been invovled in dmd as "Nils Lankila" and "Stian

Re: styx, a programming languange written in D, is on the bootstrap path

2021-01-18 Thread Basile B. via Digitalmars-d-announce
On Monday, 18 January 2021 at 17:45:16 UTC, Basile B. wrote: On Friday, 15 January 2021 at 19:40:11 UTC, Ola Fosheim Grøstad wrote: [...] Yeah, in addition to my real name, I've been invovled in dmd as "Nils Lankila" and "Stian Gulpen" which are names generated using specialized services.

Re: styx, a programming languange written in D, is on the bootstrap path

2021-01-18 Thread Basile B. via Digitalmars-d-announce
On Friday, 15 January 2021 at 19:40:11 UTC, Ola Fosheim Grøstad wrote: On Friday, 15 January 2021 at 19:18:09 UTC, Basile B. wrote: I plan to use dparse for the most part, not only to convert but also to detect non bootstrapable code or missing features. Ah, smart. I've been thinking about

Re: How define accepted types in a template parameter?

2021-01-16 Thread Basile B. via Digitalmars-d-learn
On Saturday, 16 January 2021 at 18:39:03 UTC, Marcone wrote: For example, I want my function template to only accept integer or string; You can do that with either - `static if` inside the body [1] import std.traits; void foo(T)(T t) { static if (isIntegral!T) {} else static

Re: Template alias as template specialisation not recognized.

2021-01-15 Thread Basile B. via Digitalmars-d-learn
On Saturday, 16 January 2021 at 01:21:24 UTC, Paul wrote: I'm having issues when trying to use a template alias as a template specialisation. When using the following: alias Vec(uint size, Type) = Mat!(size, 1, Type); void setUniform(V : Vec!(L, bool), int L)(string name, V value) {...}

Re: Open question: what code pattern you use usually for null safety problem

2021-01-15 Thread Basile B. via Digitalmars-d-learn
On Thursday, 14 January 2021 at 18:24:44 UTC, ddcovery wrote: I know there is other threads about null safety and the "possible" ways to support this in D and so on. [...] If it's not a bother, I'd like to know how you usually approach it [...] Thanks!!! I have a opDispatch solution here

Re: styx, a programming languange written in D, is on the bootstrap path

2021-01-15 Thread Basile B. via Digitalmars-d-announce
On Friday, 15 January 2021 at 19:25:38 UTC, Per Nordlöw wrote: On Friday, 15 January 2021 at 19:18:09 UTC, Basile B. wrote: - DotExpression aliases (they have been proposed to DMD this summer when I worked "under cover" as Nils.) Can you give examples of what a DotExpression alias is? They

Re: styx, a programming languange written in D, is on the bootstrap path

2021-01-15 Thread Basile B. via Digitalmars-d-announce
On Friday, 15 January 2021 at 09:54:59 UTC, Ola Fosheim Grøstad wrote: On Thursday, 14 January 2021 at 17:51:51 UTC, Basile B. wrote: This is the last[1] occasion to speak about a programming language initiatly made in D, as the bootstrap phase is very near. Interesting project! How did you

Re: styx, a programming languange written in D, is on the bootstrap path

2021-01-15 Thread Basile B. via Digitalmars-d-announce
On Thursday, 14 January 2021 at 20:21:42 UTC, Daniel N wrote: On Thursday, 14 January 2021 at 17:51:51 UTC, Basile B. wrote: This is the last[1] occasion to speak about a programming language initiatly made in D, as the bootstrap phase is very near. I'd like to thank the D compiler

styx, a programming languange written in D, is on the bootstrap path

2021-01-14 Thread Basile B. via Digitalmars-d-announce
This is the last[1] occasion to speak about a programming language initiatly made in D, as the bootstrap phase is very near. I'd like to thank the D compiler developers, that let me work on DMD even if I borrow another path. [1] : https://gitlab.com/styx-lang/styx

Re: Why many programmers don't like GC?

2021-01-14 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 13 January 2021 at 18:58:56 UTC, Marcone wrote: I've always heard programmers complain about Garbage Collector GC. But I never understood why they complain. What's bad about GC? Semi serious answer: In the domain of hoby-ism and small companies programmers that work with

Re: Discussion Thread: DIP 1039--Static Arrays with Inferred Length--Community Review Round 1

2021-01-06 Thread Basile B. via Digitalmars-d-announce
On Wednesday, 6 January 2021 at 11:55:12 UTC, Ola Fosheim Grøstad wrote: On Wednesday, 6 January 2021 at 11:39:08 UTC, Basile B. wrote: Hmm... My take is that this proposal is auto with a constraint, except it will also do implicit conversion. yeah the split of DIP feedbacks and DIP

Re: Discussion Thread: DIP 1039--Static Arrays with Inferred Length--Community Review Round 1

2021-01-06 Thread Basile B. via Digitalmars-d-announce
On Wednesday, 6 January 2021 at 11:29:42 UTC, Ola Fosheim Grøstad wrote: On Wednesday, 6 January 2021 at 11:18:22 UTC, Basile B. wrote: I thought about auto when reading the DIP too, but auto is more used like a Type (although being a storage class ;) ). It's never used to infer a value, i.e

Re: Discussion Thread: DIP 1039--Static Arrays with Inferred Length--Community Review Round 1

2021-01-06 Thread Basile B. via Digitalmars-d-announce
On Wednesday, 6 January 2021 at 11:11:41 UTC, Ola Fosheim Grøstad wrote: On Wednesday, 6 January 2021 at 10:55:39 UTC, Ola Fosheim Grøstad wrote: int[_] = … or _[_] … To expand on this with more examples, you might want to constrain "auto" in various ways with pattern matching: //

Re: Discussion Thread: DIP 1039--Static Arrays with Inferred Length--Community Review Round 1

2021-01-06 Thread Basile B. via Digitalmars-d-announce
On Wednesday, 6 January 2021 at 10:55:39 UTC, Ola Fosheim Grøstad wrote: I am in favour of more controlled type inference in general, but perhaps this one is a bit specific. What if you defined "_" to mean "deduce whatever should be in this spot", not only for static arrays, but for all types?

Re: Discussion Thread: DIP 1039--Static Arrays with Inferred Length--Community Review Round 1

2021-01-06 Thread Basile B. via Digitalmars-d-announce
On Wednesday, 6 January 2021 at 09:55:34 UTC, Basile B. wrote: On Wednesday, 6 January 2021 at 09:24:28 UTC, Mike Parker wrote: On Wednesday, 6 January 2021 at 09:21:53 UTC, Mike Parker wrote: [...] The Feedback Thread is here:

Re: Discussion Thread: DIP 1039--Static Arrays with Inferred Length--Community Review Round 1

2021-01-06 Thread Basile B. via Digitalmars-d-announce
On Wednesday, 6 January 2021 at 09:24:28 UTC, Mike Parker wrote: On Wednesday, 6 January 2021 at 09:21:53 UTC, Mike Parker wrote: However, if you have any specific feedback on how to improve the proposal itself, then please post it in the feedback thread. The feedback thread will be the

Re: Hardcoded filepaths in compiled exe

2020-12-29 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 30 December 2020 at 01:21:37 UTC, Steven Schveighoffer wrote: On 12/29/20 7:46 PM, Basile B. wrote: On Tuesday, 29 December 2020 at 23:11:25 UTC, Steven Schveighoffer wrote: But I would think a feature should exist that masks the base directory of exception file names. Probably

Re: Hardcoded filepaths in compiled exe

2020-12-29 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 29 December 2020 at 23:11:25 UTC, Steven Schveighoffer wrote: But I would think a feature should exist that masks the base directory of exception file names. Probably worth an enhancement request. -Steve Also aren't dmd output binaries supposed to be "reproducible" ?

Re: Hardcoded filepaths in compiled exe

2020-12-29 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 29 December 2020 at 21:27:07 UTC, Raikia wrote: Interesting. I was able to clobber it with bbe with no issues. I'm surprised the compiler doesn't strip out this potentially sensitive metadata, but I guess I'll just patch it out as part of my build process. Thanks! Other super

Re: dmd: enum to!string slows down compilation

2020-12-29 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 29 December 2020 at 22:42:16 UTC, kdevel wrote: Why is the enum to!string conversion so slow? ~~~slowenumtostringconversion.d private enum S { A, B, C, D, }; [...] one factor is all the template constraints that are evaluated until the right std.conv.to overload gets selected.

Re: Hardcoded filepaths in compiled exe

2020-12-29 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 29 December 2020 at 16:13:53 UTC, Raikia wrote: Hey all, [...] $ strings -a program.exe | grep 'dmd2' C:\D\dmd2\windows\bin\..\..\src\phobos\std\file.d C:\D\dmd2\windows\bin\..\..\src\phobos\std\utf.d C:\D\dmd2\windows\bin\..\..\src\phobos\std\base64.d This problem is more

Re: Get the code of any D-entity as string?

2020-12-27 Thread Basile B. via Digitalmars-d-learn
On Sunday, 27 December 2020 at 12:20:01 UTC, sighoya wrote: On Sunday, 27 December 2020 at 04:13:53 UTC, Max Haughton wrote: Not possible although implementing as a __trait would be about 15 lines I think. I think that too, and it would nicely reuse the work of the compiler to parse the

Re: Get the code of any D-entity as string?

2020-12-26 Thread Basile B. via Digitalmars-d-learn
On Saturday, 26 December 2020 at 12:38:21 UTC, sighoya wrote: On Friday, 25 December 2020 at 23:04:15 UTC, Ali Çehreli wrote: I am probably misunderstanding it but there is the .stringof property for all types: T.stringof. But does stringof really print the declaration as string and not the

Re: gdb + Windows 64: No debugging symbols found

2020-12-26 Thread Basile B. via Digitalmars-d-learn
On Saturday, 26 December 2020 at 11:55:58 UTC, Виталий Фадеев wrote: We have: [...] Problem is: $ gdb ./app.exe GNU gdb (GDB) 9.2 ... (No debugging symbols found in ./app.exe) What is a right way to build .exe and debug with gdb ? Try to build with latest version of LDC and

Re: Slice allocation after appending

2020-12-22 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 22 December 2020 at 22:12:29 UTC, Rekel wrote: According to the D slice article (https://dlang.org/articles/d-array-article.html), slices do not care where they start, only where they end, when checking whether expanding in place is permitable, or at least that is what I

Re: Can I use dub to generate docs?

2020-12-14 Thread Basile B. via Digitalmars-d-learn
On Monday, 14 December 2020 at 02:54:12 UTC, Jack wrote: like dmd's -D flag? you can try $ dub run harbored-mod -- $(find -iname *.d) That will generate doc for all d source in the current working directory.

Re: How to check that function gets ref parameter?

2020-12-13 Thread Basile B. via Digitalmars-d-learn
On Sunday, 13 December 2020 at 16:41:06 UTC, Andrey Zherikov wrote: I'm trying to check that function has 'ref' parameter. The only way I found so far is to use std.traits.Parameters. Here is the code I have: void f(int) {} void g(ref int) {} void main() {

Re: Is this a compiler error? "recursive template expansion"

2020-12-08 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 8 December 2020 at 20:11:40 UTC, Nathan S. wrote: The following code fails to compile. Is this a compiler error or if not what is wrong with the code? What is wrong is that partial specialization is not correct. The correct partial specialization is: --- struct Template2(T) {

Re: betterC question

2020-11-19 Thread Basile B. via Digitalmars-d-learn
On Thursday, 19 November 2020 at 00:07:12 UTC, Dibyendu Majumdar wrote: I have simple test program: import core.stdc.stdio : printf; void test() { int* a; printf("a == null %d\n", a == null); } int function() fp = test; extern (C) void main() { fp(); } Why do I get:

Re: LDC 1.24.0-beta1

2020-10-20 Thread Basile B. via Digitalmars-d-announce
On Monday, 19 October 2020 at 20:49:14 UTC, Andre Pany wrote: On Monday, 19 October 2020 at 18:48:11 UTC, notna wrote: On Sunday, 18 October 2020 at 22:40:53 UTC, aberba wrote: It would be convenient if you provided a .exe installer as well. Not sure what to do with the .7z file without

Re: Best way to confine project to 64 bit builds only?

2020-10-17 Thread Basile B. via Digitalmars-d-learn
On Saturday, 17 October 2020 at 14:50:47 UTC, NonNull wrote: I have inherited an open source C project that assumes that the size of a long and the size of a pointer are the same, and I have translated it into very similar D just like

Re: Dexed debugger UI now supports inspection of the variables based on mouse motion

2020-10-13 Thread Basile B. via Digitalmars-d-debugger
On Monday, 12 October 2020 at 06:36:13 UTC, Imperatorn wrote: On Tuesday, 22 September 2020 at 23:39:39 UTC, Basile B. wrote: On Sunday, 20 September 2020 at 17:13:35 UTC, Imperatorn wrote: https://forum.dlang.org/post/skqjdvgmwpqdqbpxs...@forum.dlang.org On Thursday, 13 February 2020 at

Re: Count template parameters of method

2020-10-11 Thread Basile B. via Digitalmars-d-learn
On Sunday, 11 October 2020 at 06:53:59 UTC, Andrey wrote: Hello, How to count a number of parameters in uninitialized template method? For example: struct Test { void abc(int a, bool status, string text)() {} { The method "Test.abc" has three template paramenters. I know that

Re: Release D 2.094.0

2020-09-30 Thread Basile B. via Digitalmars-d-announce
On Wednesday, 30 September 2020 at 18:38:25 UTC, Basile B. wrote: On Tuesday, 29 September 2020 at 13:38:58 UTC, apz28 wrote: On Saturday, 26 September 2020 at 21:45:09 UTC, Martin Nowak wrote: Glad to announce D 2.094.0, ♥ to the 49 contributors. This release comes with faster compiler

Re: Release D 2.094.0

2020-09-30 Thread Basile B. via Digitalmars-d-announce
On Tuesday, 29 September 2020 at 13:38:58 UTC, apz28 wrote: On Saturday, 26 September 2020 at 21:45:09 UTC, Martin Nowak wrote: Glad to announce D 2.094.0, ♥ to the 49 contributors. This release comes with faster compiler binaries (built with ldc), direct git dependencies in dub, better type

Re: Deprecation in traits

2020-09-30 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 29 September 2020 at 17:08:40 UTC, Frak wrote: Hi folks, I've this: /Users/frak/dlang/ldc-1.23.0/bin/../import/std/traits.d(3711): Deprecation: function `std.typecons.Nullable!long.Nullable.get_` is deprecated - Implicit conversion with `alias Nullable.get this` will be removed

Re: Dexed debugger UI now supports inspection of the variables based on mouse motion

2020-09-22 Thread Basile B. via Digitalmars-d-debugger
On Sunday, 20 September 2020 at 17:13:35 UTC, Imperatorn wrote: https://forum.dlang.org/post/skqjdvgmwpqdqbpxs...@forum.dlang.org On Thursday, 13 February 2020 at 13:24:58 UTC, Basile B. wrote: On Thursday, 13 February 2020 at 09:06:26 UTC, Basile B. wrote: [...] related commit

Re: How to get the element type of an array?

2020-08-24 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 25 August 2020 at 03:41:06 UTC, Jon Degenhardt wrote: What's the best way to get the element type of an array at compile time? Something like std.range.ElementType except that works on any array type. There is std.traits.ForeachType, but it wasn't clear if that was the right

Re: Introspecting a package for submodules

2020-08-24 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 25 August 2020 at 00:09:38 UTC, Adam D. Ruppe wrote: On Monday, 24 August 2020 at 22:32:52 UTC, Anonymouse wrote: How do I do this? (Is there some other way?) Not really a way. A package doesn't quite exist in D; there is no formal construct that is a package and has a defined

Re: LDC 1.23.0

2020-08-19 Thread Basile B. via Digitalmars-d-announce
On Wednesday, 19 August 2020 at 23:47:34 UTC, kinke wrote: On Wednesday, 19 August 2020 at 23:30:30 UTC, Basile B. wrote: gdwarf really ? this is possible ? Not that this is not a great news but you told me once this was not quite possible

Re: LDC 1.23.0

2020-08-19 Thread Basile B. via Digitalmars-d-announce
On Wednesday, 19 August 2020 at 17:45:46 UTC, kinke wrote: Glad to announce LDC 1.23 - some highlights: - Based on D 2.093.1+. - LLVM for prebuilt packages bumped to v10.0.1; min version raised to 6.0. - Cross-compiling to the iOS/x86_64 simulator now works out-of-the-box with the prebuilt

Re: alias restriction??!

2020-07-19 Thread Basile B. via Digitalmars-d-learn
On Sunday, 19 July 2020 at 15:00:59 UTC, Paul Backus wrote: On Sunday, 19 July 2020 at 12:42:47 UTC, Carl Sturtivant wrote: On Sunday, 19 July 2020 at 12:08:07 UTC, Paul Backus wrote: Easiest workaround: ref inout(long) Second() inout { return second.one; } Was trying to avoid this for

Re: alias restriction??!

2020-07-18 Thread Basile B. via Digitalmars-d-learn
On Saturday, 18 July 2020 at 22:49:18 UTC, Dennis wrote: On Saturday, 18 July 2020 at 18:46:16 UTC, Carl Sturtivant wrote: Is there any way to avoid the duplication of the entries in the anonymous union, aside from using a mixin template? I think this would be fixed if

Re: Uploading coverage to Codecov doesn't work

2020-07-14 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 14 July 2020 at 17:52:25 UTC, Basile B. wrote: On Tuesday, 14 July 2020 at 11:05:17 UTC, Mitacha wrote: On Saturday, 11 July 2020 at 09:43:39 UTC, Basile B. wrote: On Wednesday, 8 July 2020 at 15:55:58 UTC, Mitacha wrote: I filed an issue on codecov community forum

Re: Uploading coverage to Codecov doesn't work

2020-07-14 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 14 July 2020 at 11:05:17 UTC, Mitacha wrote: On Saturday, 11 July 2020 at 09:43:39 UTC, Basile B. wrote: On Wednesday, 8 July 2020 at 15:55:58 UTC, Mitacha wrote: I filed an issue on codecov community forum https://community.codecov.io/t/uploading-d-lang-coverage-doesnt-work/1740

Re: Uploading coverage to Codecov doesn't work

2020-07-11 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 8 July 2020 at 15:55:58 UTC, Mitacha wrote: Hello there, I've been trying to setup bitbucket pipelines to submit coverage to codecov, but with no luck. I use `dub run -b unittest-cov` and it generates .lst files correctly, then `bash <(curl -s https://codecov.io/bash) -t

Re: Generating struct .init at run time?

2020-07-02 Thread Basile B. via Digitalmars-d-learn
On Thursday, 2 July 2020 at 10:37:27 UTC, kinke wrote: I don't think a struct should ever be that large, as it can probably only live on the heap anyway and only passed around by refs. I'd probably use a thin struct instead, containing and managing a `double[]` member (or

Re: filter custom version id from __traits code

2020-06-09 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 9 June 2020 at 18:08:01 UTC, Stanislav Blinov wrote: On Tuesday, 9 June 2020 at 17:40:10 UTC, Basile B. wrote: Any idea ? As I replied in the issue report: Instead of static if (!is(mixin(member) == module) && !(is(mixin(member use static if (is(typeof(mixin(member

filter custom version id from __traits code

2020-06-09 Thread Basile B. via Digitalmars-d-learn
I don't see how to filter a custom version identifier from this traits code: --- module test; import std.traits : isCallable; version(all) version = my_version; private bool onlyFuncs() { bool result = true; foreach (member; __traits(allMembers, mixin(__MODULE__))) {

Re: non-constant expression while initializing two dim array

2020-06-08 Thread Basile B. via Digitalmars-d-learn
On Monday, 8 June 2020 at 06:37:18 UTC, tirithen wrote: How can I initialize my two dimensional array? When I try to run the code below I get the error: Error: non-constant expression ["user":[cast(Capability)0], "administrator":[cast(Capability)1]] Code: enum Capability {

Re: Dub Error Message "Invalid variable: DUB"

2020-06-07 Thread Basile B. via Digitalmars-d-learn
On Sunday, 7 June 2020 at 12:24:13 UTC, Russel Winder wrote: On Sun, 2020-06-07 at 10:30 +, Basile B. via Digitalmars-d-learn wrote: […] What is the docker image that you use ? If it is an older version maybe that the $DUB env variable is not yet supported by the dub version that's

Re: Dub Error Message "Invalid variable: DUB"

2020-06-07 Thread Basile B. via Digitalmars-d-learn
On Sunday, 7 June 2020 at 10:06:14 UTC, Russel Winder wrote: On Sun, 2020-06-07 at 10:24 +0100, Russel Winder wrote: Hi, Why on earth is Dub sending out this error message (Invalid variable: DUB) on GitLab but not on Travis-CI or locally? OK, that was slightly rhetorical, more reasonably,

Re: Should it compile?

2020-06-06 Thread Basile B. via Digitalmars-d-learn
On Saturday, 6 June 2020 at 08:55:20 UTC, Jack Applegame wrote: Should it compile? ```d import std.algorithm.mutation; void main() { const char a = void; const char b ='b'; moveEmplace(b, a); // mutation.d: Error: cannot modify const expression target assert(a == 'b'); } ```

Re: Fastest way to check using if identifier has already been defined, using static if or similar?

2020-06-03 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 3 June 2020 at 10:24:44 UTC, Simen Kjærås wrote: On Wednesday, 3 June 2020 at 09:39:34 UTC, Basile B. wrote: You can use this template: enum Exists(alias T) = is(typeof(T)); I don't know if there's a faster way bu this technic is used, notatbly in phobos, to workaroud issues

Re: Fastest way to check using if identifier has already been defined, using static if or similar?

2020-06-03 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 3 June 2020 at 09:03:22 UTC, drathier wrote: I'm generating some code. Some of the generated types need to be overridden, so I define them manually at the top of the generated file. Then I need to guard against redefining the identifier (type/value/function) later on, in the

Re: Making alias of a struct field needs "this".

2020-06-02 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 2 June 2020 at 09:07:08 UTC, Basile B. wrote: On Tuesday, 2 June 2020 at 08:56:13 UTC, realhet wrote: [...] There's a language rule, expressions cant be aliased, however D has a bug, some expressions that look like type can be aliased, then when you use them you have an error

Re: Making alias of a struct field needs "this".

2020-06-02 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 2 June 2020 at 08:56:13 UTC, realhet wrote: Hello, I have a 2 level nested struct structure with nice descriptive field names. And I thought it will be easy to alias those identifierLists with a few letter names and do some calculations on them. But I'm having an error. struct

Re: Postblit segfault.

2020-06-02 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 2 June 2020 at 06:34:14 UTC, MaoKo wrote: On Monday, 1 June 2020 at 19:52:39 UTC, Basile B. wrote: On Monday, 1 June 2020 at 15:55:45 UTC, H. S. Teoh wrote: On Mon, Jun 01, 2020 at 03:27:11PM +, Basile B. via Digitalmars-d-learn wrote: [...] Possibly a backend bug (keyword

Re: Postblit segfault.

2020-06-01 Thread Basile B. via Digitalmars-d-learn
On Monday, 1 June 2020 at 15:55:45 UTC, H. S. Teoh wrote: On Mon, Jun 01, 2020 at 03:27:11PM +, Basile B. via Digitalmars-d-learn wrote: [...] Possibly a backend bug (keyword "wrong code"), caused by either of [1] or [2] [1] https://github.com/dlang/dmd/pull/9357 [2] https://

Re: Postblit segfault.

2020-06-01 Thread Basile B. via Digitalmars-d-learn
On Monday, 1 June 2020 at 14:53:43 UTC, H. S. Teoh wrote: On Mon, Jun 01, 2020 at 01:53:09PM +, Bastiaan Veelo via Digitalmars-d-learn wrote: On Monday, 1 June 2020 at 09:42:44 UTC, Boris Carvajal wrote: > On Monday, 1 June 2020 at 06:35:36 UTC, MaoKo wrote: > > Hello, I don't understand

Re: D IDE Dexed - v3.9.0

2020-05-29 Thread Basile B. via Digitalmars-d-announce
On Saturday, 9 May 2020 at 11:33:08 UTC, notna wrote: On Friday, 8 May 2020 at 00:46:04 UTC, Basile B. wrote: Sorry, I'm tempted to drop official Windows support good. I have an old win7 DVD but I'd prefer if someone who actually uses Windows could fix this. For now let's talk here

Re: redirect std out to a string?

2020-05-21 Thread Basile B. via Digitalmars-d-learn
On Thursday, 21 May 2020 at 04:29:30 UTC, Kaitlyn Emmons wrote: is there a way to redirect std out to a string or a buffer without using a temp file? yes: --- #!dmd -betterC module runnable; extern(C) int main() { import core.sys.posix.stdio : fclose, stdout, fmemopen, printf, fflush;

Re: Template type deduction question

2020-05-21 Thread Basile B. via Digitalmars-d-learn
On Thursday, 21 May 2020 at 07:16:11 UTC, Basile B. wrote: On Thursday, 21 May 2020 at 04:46:02 UTC, data pulverizer wrote: I'd like to pass kernel functions using: ``` auto calculateKernelMatrix(K, T)(K!(T) Kernel, Matrix!(T) data) { ... } ``` and call it using

Re: Template type deduction question

2020-05-21 Thread Basile B. via Digitalmars-d-learn
On Thursday, 21 May 2020 at 04:46:02 UTC, data pulverizer wrote: I'd like to pass kernel functions using: ``` auto calculateKernelMatrix(K, T)(K!(T) Kernel, Matrix!(T) data) { ... } ``` and call it using `calculateKernelMatrix(myKernel, myData);` but I get a type deduction error and have

Re: [OT] What do you guys think of dark comedy channel on IT sh.. stuff?

2020-05-13 Thread Basile B. via Digitalmars-d-announce
On Tuesday, 12 May 2020 at 07:52:29 UTC, Dmitry Olshansky wrote: I find that I can vaguely amusing 100% of the day and I love standup comedy... So I thought maybe I can give it a shot with a youtube channel? I already invent a cool personality - think Dirk Gently in computer science

Re: D IDE Dexed - v3.9.0

2020-05-07 Thread Basile B. via Digitalmars-d-announce
On Thursday, 7 May 2020 at 23:50:51 UTC, notna wrote: On Tuesday, 5 May 2020 at 22:00:30 UTC, Basile B. wrote: Try the default procedure now. i.e using lazbuild as explained in the documentation. As the library is statically linked this is mandatory anyway. pull'ed incl submodules again...

Re: D IDE Dexed - v3.9.0

2020-05-05 Thread Basile B. via Digitalmars-d-announce
On Tuesday, 5 May 2020 at 20:05:25 UTC, notna wrote: On Tuesday, 5 May 2020 at 20:03:38 UTC, notna wrote: On Tuesday, 5 May 2020 at 12:53:29 UTC, Basile B. wrote: On Win10 64Bit, after compiling as described in https://basile.b.gitlab.io/dexed/build.html, I have a "dexed.exe" but if I run

Re: D IDE Dexed - v3.9.0

2020-05-05 Thread Basile B. via Digitalmars-d-announce
On Sunday, 3 May 2020 at 18:40:37 UTC, notna wrote: On Saturday, 25 April 2020 at 06:55:19 UTC, Basile B. wrote: Despite of the mini drama last year I've continued developping dexed. The changelog since last announce here is a bit long, check https://gitlab.com/basile.b/dexed/-/releases

Re: D IDE Dexed - v3.9.0

2020-05-03 Thread Basile B. via Digitalmars-d-announce
On Sunday, 3 May 2020 at 18:40:37 UTC, notna wrote: On Saturday, 25 April 2020 at 06:55:19 UTC, Basile B. wrote: Despite of the mini drama last year I've continued developping dexed. The changelog since last announce here is a bit long, check https://gitlab.com/basile.b/dexed/-/releases

Re: DDOC generator Harbored-Mod - v0.3.4

2020-04-25 Thread Basile B. via Digitalmars-d-announce
On Saturday, 25 April 2020 at 08:36:40 UTC, 9il wrote: On Saturday, 25 April 2020 at 06:50:07 UTC, Basile B. wrote: [1] https://gitlab.com/basile.b/harbored-mod Note that I don't have access to the DUB registry to update the location so Ilya Y. if you read this maybe you can do that [2] ;).

<    1   2   3   4   5   6   7   8   9   10   >